aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/file.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-05-16 21:06:58 -0400
committerJames Morris <jmorris@namei.org>2010-08-02 01:33:35 -0400
commit4c3e9e2ded48bcf696a45945ea7d25bb15b873fd (patch)
tree0be326f0f90b0279ae83594e9244c3739d348df1 /security/tomoyo/file.c
parentbabcd37821fba57048b30151969d28303f2a8b6b (diff)
TOMOYO: Add numeric values grouping support.
This patch adds numeric values grouping support, which is useful for grouping numeric values such as file's UID, DAC's mode, ioctl()'s cmd number. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/file.c')
-rw-r--r--security/tomoyo/file.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c
index 1c6f8238ec47..2dffe0730918 100644
--- a/security/tomoyo/file.c
+++ b/security/tomoyo/file.c
@@ -76,6 +76,20 @@ static bool tomoyo_compare_name_union_pattern(const struct tomoyo_path_info
76 return false; 76 return false;
77} 77}
78 78
79void tomoyo_put_number_union(struct tomoyo_number_union *ptr)
80{
81 if (ptr && ptr->is_group)
82 tomoyo_put_number_group(ptr->group);
83}
84
85bool tomoyo_compare_number_union(const unsigned long value,
86 const struct tomoyo_number_union *ptr)
87{
88 if (ptr->is_group)
89 return tomoyo_number_matches_group(value, value, ptr->group);
90 return value >= ptr->values[0] && value <= ptr->values[1];
91}
92
79/** 93/**
80 * tomoyo_path2keyword - Get the name of single path operation. 94 * tomoyo_path2keyword - Get the name of single path operation.
81 * 95 *