aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/file.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-02-15 19:46:15 -0500
committerJames Morris <jmorris@namei.org>2010-02-16 01:26:36 -0500
commit97d6931ead3e89a764cdaa3ad0924037367f0d34 (patch)
treead69e76208832699a97e897af73b6aa23a655609 /security/tomoyo/file.c
parent7ef612331fb219620cc1abfc2446bb027d388aa0 (diff)
TOMOYO: Remove unneeded parameter.
tomoyo_path_perm() tomoyo_path2_perm() and tomoyo_check_rewrite_permission() always receive tomoyo_domain(). We can move it from caller to callee. 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.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/security/tomoyo/file.c b/security/tomoyo/file.c
index 09feaf24864..db342ef87af 100644
--- a/security/tomoyo/file.c
+++ b/security/tomoyo/file.c
@@ -1135,17 +1135,16 @@ int tomoyo_check_open_permission(struct tomoyo_domain_info *domain,
1135/** 1135/**
1136 * tomoyo_path_perm - Check permission for "create", "unlink", "mkdir", "rmdir", "mkfifo", "mksock", "mkblock", "mkchar", "truncate", "symlink", "ioctl", "chmod", "chown", "chgrp", "chroot", "mount" and "unmount". 1136 * tomoyo_path_perm - Check permission for "create", "unlink", "mkdir", "rmdir", "mkfifo", "mksock", "mkblock", "mkchar", "truncate", "symlink", "ioctl", "chmod", "chown", "chgrp", "chroot", "mount" and "unmount".
1137 * 1137 *
1138 * @domain: Pointer to "struct tomoyo_domain_info".
1139 * @operation: Type of operation. 1138 * @operation: Type of operation.
1140 * @path: Pointer to "struct path". 1139 * @path: Pointer to "struct path".
1141 * 1140 *
1142 * Returns 0 on success, negative value otherwise. 1141 * Returns 0 on success, negative value otherwise.
1143 */ 1142 */
1144int tomoyo_path_perm(struct tomoyo_domain_info *domain, 1143int tomoyo_path_perm(const u8 operation, struct path *path)
1145 const u8 operation, struct path *path)
1146{ 1144{
1147 int error = -ENOMEM; 1145 int error = -ENOMEM;
1148 struct tomoyo_path_info *buf; 1146 struct tomoyo_path_info *buf;
1147 struct tomoyo_domain_info *domain = tomoyo_domain();
1149 const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE); 1148 const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE);
1150 const bool is_enforce = (mode == 3); 1149 const bool is_enforce = (mode == 3);
1151 int idx; 1150 int idx;
@@ -1180,15 +1179,14 @@ int tomoyo_path_perm(struct tomoyo_domain_info *domain,
1180/** 1179/**
1181 * tomoyo_check_rewrite_permission - Check permission for "rewrite". 1180 * tomoyo_check_rewrite_permission - Check permission for "rewrite".
1182 * 1181 *
1183 * @domain: Pointer to "struct tomoyo_domain_info".
1184 * @filp: Pointer to "struct file". 1182 * @filp: Pointer to "struct file".
1185 * 1183 *
1186 * Returns 0 on success, negative value otherwise. 1184 * Returns 0 on success, negative value otherwise.
1187 */ 1185 */
1188int tomoyo_check_rewrite_permission(struct tomoyo_domain_info *domain, 1186int tomoyo_check_rewrite_permission(struct file *filp)
1189 struct file *filp)
1190{ 1187{
1191 int error = -ENOMEM; 1188 int error = -ENOMEM;
1189 struct tomoyo_domain_info *domain = tomoyo_domain();
1192 const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE); 1190 const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE);
1193 const bool is_enforce = (mode == 3); 1191 const bool is_enforce = (mode == 3);
1194 struct tomoyo_path_info *buf; 1192 struct tomoyo_path_info *buf;
@@ -1217,19 +1215,18 @@ int tomoyo_check_rewrite_permission(struct tomoyo_domain_info *domain,
1217/** 1215/**
1218 * tomoyo_path2_perm - Check permission for "rename", "link" and "pivot_root". 1216 * tomoyo_path2_perm - Check permission for "rename", "link" and "pivot_root".
1219 * 1217 *
1220 * @domain: Pointer to "struct tomoyo_domain_info".
1221 * @operation: Type of operation. 1218 * @operation: Type of operation.
1222 * @path1: Pointer to "struct path". 1219 * @path1: Pointer to "struct path".
1223 * @path2: Pointer to "struct path". 1220 * @path2: Pointer to "struct path".
1224 * 1221 *
1225 * Returns 0 on success, negative value otherwise. 1222 * Returns 0 on success, negative value otherwise.
1226 */ 1223 */
1227int tomoyo_path2_perm(struct tomoyo_domain_info * const domain, 1224int tomoyo_path2_perm(const u8 operation, struct path *path1,
1228 const u8 operation, struct path *path1,
1229 struct path *path2) 1225 struct path *path2)
1230{ 1226{
1231 int error = -ENOMEM; 1227 int error = -ENOMEM;
1232 struct tomoyo_path_info *buf1, *buf2; 1228 struct tomoyo_path_info *buf1, *buf2;
1229 struct tomoyo_domain_info *domain = tomoyo_domain();
1233 const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE); 1230 const u8 mode = tomoyo_check_flags(domain, TOMOYO_MAC_FOR_FILE);
1234 const bool is_enforce = (mode == 3); 1231 const bool is_enforce = (mode == 3);
1235 const char *msg; 1232 const char *msg;