Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

constify chown_common/security_path_chown

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 7fd25dac e6641edd

+7 -7
+1 -1
fs/open.c
··· 564 564 return sys_fchmodat(AT_FDCWD, filename, mode); 565 565 } 566 566 567 - static int chown_common(struct path *path, uid_t user, gid_t group) 567 + static int chown_common(const struct path *path, uid_t user, gid_t group) 568 568 { 569 569 struct inode *inode = path->dentry->d_inode; 570 570 struct inode *delegated_inode = NULL;
+1 -1
include/linux/lsm_hooks.h
··· 1375 1375 struct path *new_dir, 1376 1376 struct dentry *new_dentry); 1377 1377 int (*path_chmod)(struct path *path, umode_t mode); 1378 - int (*path_chown)(struct path *path, kuid_t uid, kgid_t gid); 1378 + int (*path_chown)(const struct path *path, kuid_t uid, kgid_t gid); 1379 1379 int (*path_chroot)(struct path *path); 1380 1380 #endif 1381 1381
+2 -2
include/linux/security.h
··· 1456 1456 struct path *new_dir, struct dentry *new_dentry, 1457 1457 unsigned int flags); 1458 1458 int security_path_chmod(struct path *path, umode_t mode); 1459 - int security_path_chown(struct path *path, kuid_t uid, kgid_t gid); 1459 + int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid); 1460 1460 int security_path_chroot(struct path *path); 1461 1461 #else /* CONFIG_SECURITY_PATH */ 1462 1462 static inline int security_path_unlink(struct path *dir, struct dentry *dentry) ··· 1513 1513 return 0; 1514 1514 } 1515 1515 1516 - static inline int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) 1516 + static inline int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) 1517 1517 { 1518 1518 return 0; 1519 1519 }
+1 -1
security/apparmor/lsm.c
··· 342 342 return common_perm_mnt_dentry(OP_CHMOD, path->mnt, path->dentry, AA_MAY_CHMOD); 343 343 } 344 344 345 - static int apparmor_path_chown(struct path *path, kuid_t uid, kgid_t gid) 345 + static int apparmor_path_chown(const struct path *path, kuid_t uid, kgid_t gid) 346 346 { 347 347 struct path_cond cond = { d_backing_inode(path->dentry)->i_uid, 348 348 d_backing_inode(path->dentry)->i_mode
+1 -1
security/security.c
··· 492 492 return call_int_hook(path_chmod, 0, path, mode); 493 493 } 494 494 495 - int security_path_chown(struct path *path, kuid_t uid, kgid_t gid) 495 + int security_path_chown(const struct path *path, kuid_t uid, kgid_t gid) 496 496 { 497 497 if (unlikely(IS_PRIVATE(d_backing_inode(path->dentry)))) 498 498 return 0;
+1 -1
security/tomoyo/tomoyo.c
··· 366 366 * 367 367 * Returns 0 on success, negative value otherwise. 368 368 */ 369 - static int tomoyo_path_chown(struct path *path, kuid_t uid, kgid_t gid) 369 + static int tomoyo_path_chown(const struct path *path, kuid_t uid, kgid_t gid) 370 370 { 371 371 int error = 0; 372 372 if (uid_valid(uid))