@@ -100,33 +100,33 @@ static int tomoyo_bprm_check_security(struct linux_binprm *bprm)
100
100
static int tomoyo_path_truncate (struct path * path , loff_t length ,
101
101
unsigned int time_attrs )
102
102
{
103
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_TRUNCATE , path );
103
+ return tomoyo_path_perm (TOMOYO_TYPE_TRUNCATE , path );
104
104
}
105
105
106
106
static int tomoyo_path_unlink (struct path * parent , struct dentry * dentry )
107
107
{
108
108
struct path path = { parent -> mnt , dentry };
109
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_UNLINK , & path );
109
+ return tomoyo_path_perm (TOMOYO_TYPE_UNLINK , & path );
110
110
}
111
111
112
112
static int tomoyo_path_mkdir (struct path * parent , struct dentry * dentry ,
113
113
int mode )
114
114
{
115
115
struct path path = { parent -> mnt , dentry };
116
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_MKDIR , & path );
116
+ return tomoyo_path_perm (TOMOYO_TYPE_MKDIR , & path );
117
117
}
118
118
119
119
static int tomoyo_path_rmdir (struct path * parent , struct dentry * dentry )
120
120
{
121
121
struct path path = { parent -> mnt , dentry };
122
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_RMDIR , & path );
122
+ return tomoyo_path_perm (TOMOYO_TYPE_RMDIR , & path );
123
123
}
124
124
125
125
static int tomoyo_path_symlink (struct path * parent , struct dentry * dentry ,
126
126
const char * old_name )
127
127
{
128
128
struct path path = { parent -> mnt , dentry };
129
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_SYMLINK , & path );
129
+ return tomoyo_path_perm (TOMOYO_TYPE_SYMLINK , & path );
130
130
}
131
131
132
132
static int tomoyo_path_mknod (struct path * parent , struct dentry * dentry ,
@@ -149,16 +149,15 @@ static int tomoyo_path_mknod(struct path *parent, struct dentry *dentry,
149
149
type = TOMOYO_TYPE_MKSOCK ;
150
150
break ;
151
151
}
152
- return tomoyo_path_perm (tomoyo_domain (), type , & path );
152
+ return tomoyo_path_perm (type , & path );
153
153
}
154
154
155
155
static int tomoyo_path_link (struct dentry * old_dentry , struct path * new_dir ,
156
156
struct dentry * new_dentry )
157
157
{
158
158
struct path path1 = { new_dir -> mnt , old_dentry };
159
159
struct path path2 = { new_dir -> mnt , new_dentry };
160
- return tomoyo_path2_perm (tomoyo_domain (), TOMOYO_TYPE_LINK , & path1 ,
161
- & path2 );
160
+ return tomoyo_path2_perm (TOMOYO_TYPE_LINK , & path1 , & path2 );
162
161
}
163
162
164
163
static int tomoyo_path_rename (struct path * old_parent ,
@@ -168,15 +167,14 @@ static int tomoyo_path_rename(struct path *old_parent,
168
167
{
169
168
struct path path1 = { old_parent -> mnt , old_dentry };
170
169
struct path path2 = { new_parent -> mnt , new_dentry };
171
- return tomoyo_path2_perm (tomoyo_domain (), TOMOYO_TYPE_RENAME , & path1 ,
172
- & path2 );
170
+ return tomoyo_path2_perm (TOMOYO_TYPE_RENAME , & path1 , & path2 );
173
171
}
174
172
175
173
static int tomoyo_file_fcntl (struct file * file , unsigned int cmd ,
176
174
unsigned long arg )
177
175
{
178
176
if (cmd == F_SETFL && ((arg ^ file -> f_flags ) & O_APPEND ))
179
- return tomoyo_check_rewrite_permission (tomoyo_domain (), file );
177
+ return tomoyo_check_rewrite_permission (file );
180
178
return 0 ;
181
179
}
182
180
@@ -196,50 +194,46 @@ static int tomoyo_dentry_open(struct file *f, const struct cred *cred)
196
194
static int tomoyo_file_ioctl (struct file * file , unsigned int cmd ,
197
195
unsigned long arg )
198
196
{
199
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_IOCTL ,
200
- & file -> f_path );
197
+ return tomoyo_path_perm (TOMOYO_TYPE_IOCTL , & file -> f_path );
201
198
}
202
199
203
200
static int tomoyo_path_chmod (struct dentry * dentry , struct vfsmount * mnt ,
204
201
mode_t mode )
205
202
{
206
203
struct path path = { mnt , dentry };
207
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_CHMOD , & path );
204
+ return tomoyo_path_perm (TOMOYO_TYPE_CHMOD , & path );
208
205
}
209
206
210
207
static int tomoyo_path_chown (struct path * path , uid_t uid , gid_t gid )
211
208
{
212
209
int error = 0 ;
213
210
if (uid != (uid_t ) - 1 )
214
- error = tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_CHOWN ,
215
- path );
211
+ error = tomoyo_path_perm (TOMOYO_TYPE_CHOWN , path );
216
212
if (!error && gid != (gid_t ) - 1 )
217
- error = tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_CHGRP ,
218
- path );
213
+ error = tomoyo_path_perm (TOMOYO_TYPE_CHGRP , path );
219
214
return error ;
220
215
}
221
216
222
217
static int tomoyo_path_chroot (struct path * path )
223
218
{
224
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_CHROOT , path );
219
+ return tomoyo_path_perm (TOMOYO_TYPE_CHROOT , path );
225
220
}
226
221
227
222
static int tomoyo_sb_mount (char * dev_name , struct path * path ,
228
223
char * type , unsigned long flags , void * data )
229
224
{
230
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_MOUNT , path );
225
+ return tomoyo_path_perm (TOMOYO_TYPE_MOUNT , path );
231
226
}
232
227
233
228
static int tomoyo_sb_umount (struct vfsmount * mnt , int flags )
234
229
{
235
230
struct path path = { mnt , mnt -> mnt_root };
236
- return tomoyo_path_perm (tomoyo_domain (), TOMOYO_TYPE_UMOUNT , & path );
231
+ return tomoyo_path_perm (TOMOYO_TYPE_UMOUNT , & path );
237
232
}
238
233
239
234
static int tomoyo_sb_pivotroot (struct path * old_path , struct path * new_path )
240
235
{
241
- return tomoyo_path2_perm (tomoyo_domain (), TOMOYO_TYPE_PIVOT_ROOT ,
242
- new_path , old_path );
236
+ return tomoyo_path2_perm (TOMOYO_TYPE_PIVOT_ROOT , new_path , old_path );
243
237
}
244
238
245
239
/*
0 commit comments