Lines Matching refs:path
36 #include "include/path.h"
197 * @path: path to check permission of (NOT NULL)
203 static int common_perm(const char *op, const struct path *path, u32 mask,
211 error = aa_path_perm(op, label, path, 0, mask, cond);
220 * @path: location to check (NOT NULL)
225 static int common_perm_cond(const char *op, const struct path *path, u32 mask)
227 struct path_cond cond = { d_backing_inode(path->dentry)->i_uid,
228 d_backing_inode(path->dentry)->i_mode
231 if (!path_mediated_fs(path->dentry))
234 return common_perm(op, path, mask, &cond);
238 * common_perm_dir_dentry - common permission wrapper when path is dir, dentry
247 static int common_perm_dir_dentry(const char *op, const struct path *dir,
251 struct path path = { .mnt = dir->mnt, .dentry = dentry };
253 return common_perm(op, &path, mask, cond);
265 static int common_perm_rm(const char *op, const struct path *dir,
290 static int common_perm_create(const char *op, const struct path *dir,
301 static int apparmor_path_unlink(const struct path *dir, struct dentry *dentry)
306 static int apparmor_path_mkdir(const struct path *dir, struct dentry *dentry,
313 static int apparmor_path_rmdir(const struct path *dir, struct dentry *dentry)
318 static int apparmor_path_mknod(const struct path *dir, struct dentry *dentry,
324 static int apparmor_path_truncate(const struct path *path)
326 return common_perm_cond(OP_TRUNC, path, MAY_WRITE | AA_MAY_SETATTR);
329 static int apparmor_path_symlink(const struct path *dir, struct dentry *dentry,
336 static int apparmor_path_link(struct dentry *old_dentry, const struct path *new_dir,
353 static int apparmor_path_rename(const struct path *old_dir, struct dentry *old_dentry,
354 const struct path *new_dir, struct dentry *new_dentry)
364 struct path old_path = { .mnt = old_dir->mnt,
366 struct path new_path = { .mnt = new_dir->mnt,
387 static int apparmor_path_chmod(const struct path *path, umode_t mode)
389 return common_perm_cond(OP_CHMOD, path, AA_MAY_CHMOD);
392 static int apparmor_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
394 return common_perm_cond(OP_CHOWN, path, AA_MAY_CHOWN);
397 static int apparmor_inode_getattr(const struct path *path)
399 return common_perm_cond(OP_GETATTR, path, AA_MAY_GETATTR);
529 static int apparmor_sb_mount(const char *dev_name, const struct path *path,
544 error = aa_remount(label, path, flags, data);
546 error = aa_bind_mount(label, path, dev_name, flags);
549 error = aa_mount_change_type(label, path, flags);
551 error = aa_move_mount(label, path, dev_name);
553 error = aa_new_mount(label, dev_name, path, type,
574 static int apparmor_sb_pivotroot(const struct path *old_path,
575 const struct path *new_path)