Lines Matching refs:dentry
176 struct dentry *dentry, u32 mask, in common_perm_dir_dentry() argument
179 struct path path = { dir->mnt, dentry }; in common_perm_dir_dentry()
194 struct dentry *dentry, u32 mask) in common_perm_mnt_dentry() argument
196 struct path path = { mnt, dentry }; in common_perm_mnt_dentry()
197 struct path_cond cond = { d_backing_inode(dentry)->i_uid, in common_perm_mnt_dentry()
198 d_backing_inode(dentry)->i_mode in common_perm_mnt_dentry()
214 struct dentry *dentry, u32 mask) in common_perm_rm() argument
216 struct inode *inode = d_backing_inode(dentry); in common_perm_rm()
219 if (!inode || !dir->mnt || !mediated_filesystem(dentry)) in common_perm_rm()
225 return common_perm_dir_dentry(op, dir, dentry, mask, &cond); in common_perm_rm()
238 static int common_perm_create(int op, struct path *dir, struct dentry *dentry, in common_perm_create() argument
243 if (!dir->mnt || !mediated_filesystem(dir->dentry)) in common_perm_create()
246 return common_perm_dir_dentry(op, dir, dentry, mask, &cond); in common_perm_create()
249 static int apparmor_path_unlink(struct path *dir, struct dentry *dentry) in apparmor_path_unlink() argument
251 return common_perm_rm(OP_UNLINK, dir, dentry, AA_MAY_DELETE); in apparmor_path_unlink()
254 static int apparmor_path_mkdir(struct path *dir, struct dentry *dentry, in apparmor_path_mkdir() argument
257 return common_perm_create(OP_MKDIR, dir, dentry, AA_MAY_CREATE, in apparmor_path_mkdir()
261 static int apparmor_path_rmdir(struct path *dir, struct dentry *dentry) in apparmor_path_rmdir() argument
263 return common_perm_rm(OP_RMDIR, dir, dentry, AA_MAY_DELETE); in apparmor_path_rmdir()
266 static int apparmor_path_mknod(struct path *dir, struct dentry *dentry, in apparmor_path_mknod() argument
269 return common_perm_create(OP_MKNOD, dir, dentry, AA_MAY_CREATE, mode); in apparmor_path_mknod()
274 struct path_cond cond = { d_backing_inode(path->dentry)->i_uid, in apparmor_path_truncate()
275 d_backing_inode(path->dentry)->i_mode in apparmor_path_truncate()
278 if (!path->mnt || !mediated_filesystem(path->dentry)) in apparmor_path_truncate()
285 static int apparmor_path_symlink(struct path *dir, struct dentry *dentry, in apparmor_path_symlink() argument
288 return common_perm_create(OP_SYMLINK, dir, dentry, AA_MAY_CREATE, in apparmor_path_symlink()
292 static int apparmor_path_link(struct dentry *old_dentry, struct path *new_dir, in apparmor_path_link()
293 struct dentry *new_dentry) in apparmor_path_link()
307 static int apparmor_path_rename(struct path *old_dir, struct dentry *old_dentry, in apparmor_path_rename()
308 struct path *new_dir, struct dentry *new_dentry) in apparmor_path_rename()
339 if (!mediated_filesystem(path->dentry)) in apparmor_path_chmod()
342 return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD); in apparmor_path_chmod()
347 struct path_cond cond = { d_backing_inode(path->dentry)->i_uid, in apparmor_path_chown()
348 d_backing_inode(path->dentry)->i_mode in apparmor_path_chown()
351 if (!mediated_filesystem(path->dentry)) in apparmor_path_chown()
359 if (!mediated_filesystem(path->dentry)) in apparmor_inode_getattr()
362 return common_perm_mnt_dentry(OP_GETATTR, path->mnt, path->dentry, in apparmor_inode_getattr()
372 if (!mediated_filesystem(file->f_path.dentry)) in apparmor_file_open()
425 !mediated_filesystem(file->f_path.dentry)) in common_file_perm()