~apparmor-dev/apparmor/2_3

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/struct_path/struct_path-security-getattr.diff

  • Committer: jrjohansen
  • Date: 2008-05-27 12:04:33 UTC
  • Revision ID: svn-v4:40609528-9d10-0410-9bd8-e926d5471da9:branches/2_3:1265
remove for-mainline dir from kernel patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: linux-2.6/include/linux/security.h
2
 
===================================================================
3
 
--- linux-2.6.orig/include/linux/security.h
4
 
+++ linux-2.6/include/linux/security.h
5
 
@@ -361,8 +361,7 @@ struct request_sock;
6
 
  *     Return 0 if permission is granted.
7
 
  * @inode_getattr:
8
 
  *     Check permission before obtaining file attributes.
9
 
- *     @mnt is the vfsmount where the dentry was looked up
10
 
- *     @dentry contains the dentry structure for the file.
11
 
+ *     @path contains the vfsmount and dentry of the file.
12
 
  *     Return 0 if permission is granted.
13
 
  * @inode_delete:
14
 
  *     @inode contains the inode structure for deleted inode.
15
 
@@ -1221,7 +1220,7 @@ struct security_operations {
16
 
        int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
17
 
        int (*inode_permission) (struct inode *inode, int mask, struct nameidata *nd);
18
 
        int (*inode_setattr)    (struct dentry *dentry, struct iattr *attr);
19
 
-       int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
20
 
+       int (*inode_getattr) (struct path *path);
21
 
         void (*inode_delete) (struct inode *inode);
22
 
        int (*inode_setxattr) (struct dentry *dentry, char *name, void *value,
23
 
                               size_t size, int flags);
24
 
@@ -1713,12 +1712,11 @@ static inline int security_inode_setattr
25
 
        return security_ops->inode_setattr (dentry, attr);
26
 
 }
27
 
 
28
 
-static inline int security_inode_getattr (struct vfsmount *mnt,
29
 
-                                         struct dentry *dentry)
30
 
+static inline int security_inode_getattr (struct path *path)
31
 
 {
32
 
-       if (unlikely (IS_PRIVATE (dentry->d_inode)))
33
 
+       if (unlikely (IS_PRIVATE (path->dentry->d_inode)))
34
 
                return 0;
35
 
-       return security_ops->inode_getattr (mnt, dentry);
36
 
+       return security_ops->inode_getattr (path);
37
 
 }
38
 
 
39
 
 static inline void security_inode_delete (struct inode *inode)
40
 
@@ -2414,8 +2412,7 @@ static inline int security_inode_setattr
41
 
        return 0;
42
 
 }
43
 
 
44
 
-static inline int security_inode_getattr (struct vfsmount *mnt,
45
 
-                                         struct dentry *dentry)
46
 
+static inline int security_inode_getattr (struct path *path)
47
 
 {
48
 
        return 0;
49
 
 }
50
 
Index: linux-2.6/security/dummy.c
51
 
===================================================================
52
 
--- linux-2.6.orig/security/dummy.c
53
 
+++ linux-2.6/security/dummy.c
54
 
@@ -333,7 +333,7 @@ static int dummy_inode_setattr (struct d
55
 
        return 0;
56
 
 }
57
 
 
58
 
-static int dummy_inode_getattr (struct vfsmount *mnt, struct dentry *dentry)
59
 
+static int dummy_inode_getattr (struct path *path)
60
 
 {
61
 
        return 0;
62
 
 }
63
 
Index: linux-2.6/security/selinux/hooks.c
64
 
===================================================================
65
 
--- linux-2.6.orig/security/selinux/hooks.c
66
 
+++ linux-2.6/security/selinux/hooks.c
67
 
@@ -2243,9 +2243,9 @@ static int selinux_inode_setattr(struct 
68
 
        return dentry_has_perm(current, NULL, dentry, FILE__WRITE);
69
 
 }
70
 
 
71
 
-static int selinux_inode_getattr(struct vfsmount *mnt, struct dentry *dentry)
72
 
+static int selinux_inode_getattr(struct path *path)
73
 
 {
74
 
-       return dentry_has_perm(current, mnt, dentry, FILE__GETATTR);
75
 
+       return dentry_has_perm(current, path->mnt, path->dentry, FILE__GETATTR);
76
 
 }
77
 
 
78
 
 static int selinux_inode_setxattr(struct dentry *dentry, char *name, void *value, size_t size, int flags)
79
 
Index: linux-2.6/fs/stat.c
80
 
===================================================================
81
 
--- linux-2.6.orig/fs/stat.c
82
 
+++ linux-2.6/fs/stat.c
83
 
@@ -43,7 +43,7 @@ int vfs_getattr(struct path *path, struc
84
 
        struct inode *inode = path->dentry->d_inode;
85
 
        int retval;
86
 
 
87
 
-       retval = security_inode_getattr(path->mnt, path->dentry);
88
 
+       retval = security_inode_getattr(path);
89
 
        if (retval)
90
 
                return retval;
91