constify chown_common/security_path_chown
[deliverable/linux.git] / security / apparmor / lsm.c
index dec607c17b6434d6b8e5416060a0202bc4cb52f4..3adbff987b77621652a225bdab94e84f9b5ce46a 100644 (file)
@@ -149,7 +149,7 @@ static int apparmor_capable(const struct cred *cred, struct user_namespace *ns,
  *
  * Returns: %0 else error code if error or permission denied
  */
-static int common_perm(int op, struct path *path, u32 mask,
+static int common_perm(int op, const struct path *path, u32 mask,
                       struct path_cond *cond)
 {
        struct aa_profile *profile;
@@ -269,13 +269,13 @@ static int apparmor_path_mknod(struct path *dir, struct dentry *dentry,
        return common_perm_create(OP_MKNOD, dir, dentry, AA_MAY_CREATE, mode);
 }
 
-static int apparmor_path_truncate(struct path *path)
+static int apparmor_path_truncate(const struct path *path)
 {
        struct path_cond cond = { d_backing_inode(path->dentry)->i_uid,
                                  d_backing_inode(path->dentry)->i_mode
        };
 
-       if (!path->mnt || !mediated_filesystem(path->dentry))
+       if (!mediated_filesystem(path->dentry))
                return 0;
 
        return common_perm(OP_TRUNC, path, MAY_WRITE | AA_MAY_META_WRITE,
@@ -342,7 +342,7 @@ static int apparmor_path_chmod(struct path *path, umode_t mode)
        return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD);
 }
 
-static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid)
+static int apparmor_path_chown(const struct path *path, kuid_t uid, kgid_t gid)
 {
        struct path_cond cond =  { d_backing_inode(path->dentry)->i_uid,
                                   d_backing_inode(path->dentry)->i_mode
This page took 0.025557 seconds and 5 git commands to generate.