aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/hooks.c
diff options
context:
space:
mode:
authorJosef Sipek <jsipek@fsl.cs.sunysb.edu>2006-12-08 05:37:38 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 11:28:49 -0500
commit3d5ff529ea222461a5fa3c4df05cbdc5eb56864d (patch)
tree28ec8432eb9212bc04e345c2e85addc132f3a34e /security/selinux/hooks.c
parent7ac6207b2a6a5b828bc333f2530a3bd48197af3e (diff)
[PATCH] struct path: convert selinux
Signed-off-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r--security/selinux/hooks.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index f5df8c70a9b5..3753416eb9b9 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -1120,8 +1120,8 @@ static int file_has_perm(struct task_struct *tsk,
1120{ 1120{
1121 struct task_security_struct *tsec = tsk->security; 1121 struct task_security_struct *tsec = tsk->security;
1122 struct file_security_struct *fsec = file->f_security; 1122 struct file_security_struct *fsec = file->f_security;
1123 struct vfsmount *mnt = file->f_vfsmnt; 1123 struct vfsmount *mnt = file->f_path.mnt;
1124 struct dentry *dentry = file->f_dentry; 1124 struct dentry *dentry = file->f_path.dentry;
1125 struct inode *inode = dentry->d_inode; 1125 struct inode *inode = dentry->d_inode;
1126 struct avc_audit_data ad; 1126 struct avc_audit_data ad;
1127 int rc; 1127 int rc;
@@ -1581,7 +1581,7 @@ static int selinux_bprm_alloc_security(struct linux_binprm *bprm)
1581static int selinux_bprm_set_security(struct linux_binprm *bprm) 1581static int selinux_bprm_set_security(struct linux_binprm *bprm)
1582{ 1582{
1583 struct task_security_struct *tsec; 1583 struct task_security_struct *tsec;
1584 struct inode *inode = bprm->file->f_dentry->d_inode; 1584 struct inode *inode = bprm->file->f_path.dentry->d_inode;
1585 struct inode_security_struct *isec; 1585 struct inode_security_struct *isec;
1586 struct bprm_security_struct *bsec; 1586 struct bprm_security_struct *bsec;
1587 u32 newsid; 1587 u32 newsid;
@@ -1621,10 +1621,10 @@ static int selinux_bprm_set_security(struct linux_binprm *bprm)
1621 } 1621 }
1622 1622
1623 AVC_AUDIT_DATA_INIT(&ad, FS); 1623 AVC_AUDIT_DATA_INIT(&ad, FS);
1624 ad.u.fs.mnt = bprm->file->f_vfsmnt; 1624 ad.u.fs.mnt = bprm->file->f_path.mnt;
1625 ad.u.fs.dentry = bprm->file->f_dentry; 1625 ad.u.fs.dentry = bprm->file->f_path.dentry;
1626 1626
1627 if (bprm->file->f_vfsmnt->mnt_flags & MNT_NOSUID) 1627 if (bprm->file->f_path.mnt->mnt_flags & MNT_NOSUID)
1628 newsid = tsec->sid; 1628 newsid = tsec->sid;
1629 1629
1630 if (tsec->sid == newsid) { 1630 if (tsec->sid == newsid) {
@@ -1708,7 +1708,7 @@ static inline void flush_unauthorized_files(struct files_struct * files)
1708 than using file_has_perm, as this particular open 1708 than using file_has_perm, as this particular open
1709 file may belong to another process and we are only 1709 file may belong to another process and we are only
1710 interested in the inode-based check here. */ 1710 interested in the inode-based check here. */
1711 struct inode *inode = file->f_dentry->d_inode; 1711 struct inode *inode = file->f_path.dentry->d_inode;
1712 if (inode_has_perm(current, inode, 1712 if (inode_has_perm(current, inode,
1713 FILE__READ | FILE__WRITE, NULL)) { 1713 FILE__READ | FILE__WRITE, NULL)) {
1714 drop_tty = 1; 1714 drop_tty = 1;
@@ -2420,7 +2420,7 @@ static int selinux_inode_listsecurity(struct inode *inode, char *buffer, size_t
2420static int selinux_file_permission(struct file *file, int mask) 2420static int selinux_file_permission(struct file *file, int mask)
2421{ 2421{
2422 int rc; 2422 int rc;
2423 struct inode *inode = file->f_dentry->d_inode; 2423 struct inode *inode = file->f_path.dentry->d_inode;
2424 2424
2425 if (!mask) { 2425 if (!mask) {
2426 /* No permission to check. Existence test. */ 2426 /* No permission to check. Existence test. */
@@ -2597,7 +2597,7 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
2597 2597
2598 switch (cmd) { 2598 switch (cmd) {
2599 case F_SETFL: 2599 case F_SETFL:
2600 if (!file->f_dentry || !file->f_dentry->d_inode) { 2600 if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
2601 err = -EINVAL; 2601 err = -EINVAL;
2602 break; 2602 break;
2603 } 2603 }
@@ -2623,7 +2623,7 @@ static int selinux_file_fcntl(struct file *file, unsigned int cmd,
2623 case F_SETLK64: 2623 case F_SETLK64:
2624 case F_SETLKW64: 2624 case F_SETLKW64:
2625#endif 2625#endif
2626 if (!file->f_dentry || !file->f_dentry->d_inode) { 2626 if (!file->f_path.dentry || !file->f_path.dentry->d_inode) {
2627 err = -EINVAL; 2627 err = -EINVAL;
2628 break; 2628 break;
2629 } 2629 }