]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
constify security_path_{link,rename}
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Mar 2016 19:27:45 +0000 (15:27 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 28 Mar 2016 04:47:36 +0000 (00:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/linux/lsm_hooks.h
include/linux/security.h
security/apparmor/lsm.c
security/security.c
security/tomoyo/tomoyo.c

index 919fb4f98e4fb14f60e6bd9f39af78aadcd0a328..52c2ac5f4855a4e0b548c7d53d6385e2983ef69d 100644 (file)
@@ -1369,10 +1369,10 @@ union security_list_options {
        int (*path_truncate)(const struct path *path);
        int (*path_symlink)(const struct path *dir, struct dentry *dentry,
                                const char *old_name);
-       int (*path_link)(struct dentry *old_dentry, struct path *new_dir,
+       int (*path_link)(struct dentry *old_dentry, const struct path *new_dir,
                                struct dentry *new_dentry);
-       int (*path_rename)(struct path *old_dir, struct dentry *old_dentry,
-                               struct path *new_dir,
+       int (*path_rename)(const struct path *old_dir, struct dentry *old_dentry,
+                               const struct path *new_dir,
                                struct dentry *new_dentry);
        int (*path_chmod)(const struct path *path, umode_t mode);
        int (*path_chown)(const struct path *path, kuid_t uid, kgid_t gid);
index ccb8c2a170e33d357f280db40d6e1034b50b5c48..82854115e36b7e3147ba25ba82274d8aeb820d34 100644 (file)
@@ -1450,10 +1450,10 @@ int security_path_mknod(const struct path *dir, struct dentry *dentry, umode_t m
 int security_path_truncate(const struct path *path);
 int security_path_symlink(const struct path *dir, struct dentry *dentry,
                          const char *old_name);
-int security_path_link(struct dentry *old_dentry, struct path *new_dir,
+int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
                       struct dentry *new_dentry);
-int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
-                        struct path *new_dir, struct dentry *new_dentry,
+int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
+                        const struct path *new_dir, struct dentry *new_dentry,
                         unsigned int flags);
 int security_path_chmod(const struct path *path, umode_t mode);
 int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid);
@@ -1493,15 +1493,15 @@ static inline int security_path_symlink(const struct path *dir, struct dentry *d
 }
 
 static inline int security_path_link(struct dentry *old_dentry,
-                                    struct path *new_dir,
+                                    const struct path *new_dir,
                                     struct dentry *new_dentry)
 {
        return 0;
 }
 
-static inline int security_path_rename(struct path *old_dir,
+static inline int security_path_rename(const struct path *old_dir,
                                       struct dentry *old_dentry,
-                                      struct path *new_dir,
+                                      const struct path *new_dir,
                                       struct dentry *new_dentry,
                                       unsigned int flags)
 {
index eadaa58bd6fdd9168e0ffab02280f2f3e3867e13..2660fbcf94d1e0e8affa72d4656584bc0aa06216 100644 (file)
@@ -280,7 +280,7 @@ static int apparmor_path_symlink(const struct path *dir, struct dentry *dentry,
                                  S_IFLNK);
 }
 
-static int apparmor_path_link(struct dentry *old_dentry, struct path *new_dir,
+static int apparmor_path_link(struct dentry *old_dentry, const struct path *new_dir,
                              struct dentry *new_dentry)
 {
        struct aa_profile *profile;
@@ -295,8 +295,8 @@ static int apparmor_path_link(struct dentry *old_dentry, struct path *new_dir,
        return error;
 }
 
-static int apparmor_path_rename(struct path *old_dir, struct dentry *old_dentry,
-                               struct path *new_dir, struct dentry *new_dentry)
+static int apparmor_path_rename(const struct path *old_dir, struct dentry *old_dentry,
+                               const struct path *new_dir, struct dentry *new_dentry)
 {
        struct aa_profile *profile;
        int error = 0;
index 7f62e2ed6a2805e72a786d6e9f183e4d0faa2e89..33b85a9601288f47ade5be7bd6d814df2ba07c66 100644 (file)
@@ -450,7 +450,7 @@ int security_path_symlink(const struct path *dir, struct dentry *dentry,
        return call_int_hook(path_symlink, 0, dir, dentry, old_name);
 }
 
-int security_path_link(struct dentry *old_dentry, struct path *new_dir,
+int security_path_link(struct dentry *old_dentry, const struct path *new_dir,
                       struct dentry *new_dentry)
 {
        if (unlikely(IS_PRIVATE(d_backing_inode(old_dentry))))
@@ -458,8 +458,8 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
        return call_int_hook(path_link, 0, old_dentry, new_dir, new_dentry);
 }
 
-int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
-                        struct path *new_dir, struct dentry *new_dentry,
+int security_path_rename(const struct path *old_dir, struct dentry *old_dentry,
+                        const struct path *new_dir, struct dentry *new_dentry,
                         unsigned int flags)
 {
        if (unlikely(IS_PRIVATE(d_backing_inode(old_dentry)) ||
index d44752562b9b9f945e5a712020804f8f05e5fdb3..6a858f2f406393c1bb9374d44411cd2c22ac76f9 100644 (file)
@@ -265,7 +265,7 @@ static int tomoyo_path_mknod(const struct path *parent, struct dentry *dentry,
  *
  * Returns 0 on success, negative value otherwise.
  */
-static int tomoyo_path_link(struct dentry *old_dentry, struct path *new_dir,
+static int tomoyo_path_link(struct dentry *old_dentry, const struct path *new_dir,
                            struct dentry *new_dentry)
 {
        struct path path1 = { new_dir->mnt, old_dentry };
@@ -283,9 +283,9 @@ static int tomoyo_path_link(struct dentry *old_dentry, struct path *new_dir,
  *
  * Returns 0 on success, negative value otherwise.
  */
-static int tomoyo_path_rename(struct path *old_parent,
+static int tomoyo_path_rename(const struct path *old_parent,
                              struct dentry *old_dentry,
-                             struct path *new_parent,
+                             const struct path *new_parent,
                              struct dentry *new_dentry)
 {
        struct path path1 = { old_parent->mnt, old_dentry };