diff options
author | Ryan O'Hara <rohara@redhat.com> | 2007-11-21 12:54:54 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2008-01-25 03:08:08 -0500 |
commit | 002ef1dc63ded14507c110d3cf83d0c3f51374ab (patch) | |
tree | c81a66cdd0b8bf49a515141c669a2600e7b01140 /fs/gfs2 | |
parent | 1a2781cfa5ed8eb82bb311d684f268c1822dae69 (diff) |
[GFS2] remove unnecessary permission checks
Remove read/write permission() checks from xattr operations.
VFS layer is already handling permission for xattrs via the
xattr_permission() call, so there is no need for gfs2 to
check permissions. Futhermore, using permission() for SELinux
xattrs ops is incorrect.
Signed-off-by: Ryan O'Hara <rohara@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/eaops.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/fs/gfs2/eaops.c b/fs/gfs2/eaops.c index aa8dbf303f6d..ef91b6e893a0 100644 --- a/fs/gfs2/eaops.c +++ b/fs/gfs2/eaops.c | |||
@@ -59,9 +59,6 @@ unsigned int gfs2_ea_name2type(const char *name, const char **truncated_name) | |||
59 | static int user_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) | 59 | static int user_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) |
60 | { | 60 | { |
61 | struct inode *inode = &ip->i_inode; | 61 | struct inode *inode = &ip->i_inode; |
62 | int error = permission(inode, MAY_READ, NULL); | ||
63 | if (error) | ||
64 | return error; | ||
65 | 62 | ||
66 | return gfs2_ea_get_i(ip, er); | 63 | return gfs2_ea_get_i(ip, er); |
67 | } | 64 | } |
@@ -70,14 +67,6 @@ static int user_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
70 | { | 67 | { |
71 | struct inode *inode = &ip->i_inode; | 68 | struct inode *inode = &ip->i_inode; |
72 | 69 | ||
73 | if (S_ISREG(inode->i_mode) || | ||
74 | (S_ISDIR(inode->i_mode) && !(inode->i_mode & S_ISVTX))) { | ||
75 | int error = permission(inode, MAY_WRITE, NULL); | ||
76 | if (error) | ||
77 | return error; | ||
78 | } else | ||
79 | return -EPERM; | ||
80 | |||
81 | return gfs2_ea_set_i(ip, er); | 70 | return gfs2_ea_set_i(ip, er); |
82 | } | 71 | } |
83 | 72 | ||
@@ -85,14 +74,6 @@ static int user_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
85 | { | 74 | { |
86 | struct inode *inode = &ip->i_inode; | 75 | struct inode *inode = &ip->i_inode; |
87 | 76 | ||
88 | if (S_ISREG(inode->i_mode) || | ||
89 | (S_ISDIR(inode->i_mode) && !(inode->i_mode & S_ISVTX))) { | ||
90 | int error = permission(inode, MAY_WRITE, NULL); | ||
91 | if (error) | ||
92 | return error; | ||
93 | } else | ||
94 | return -EPERM; | ||
95 | |||
96 | return gfs2_ea_remove_i(ip, er); | 77 | return gfs2_ea_remove_i(ip, er); |
97 | } | 78 | } |
98 | 79 | ||
@@ -108,8 +89,6 @@ static int system_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
108 | GFS2_ACL_IS_DEFAULT(er->er_name, er->er_name_len))) | 89 | GFS2_ACL_IS_DEFAULT(er->er_name, er->er_name_len))) |
109 | return -EOPNOTSUPP; | 90 | return -EOPNOTSUPP; |
110 | 91 | ||
111 | |||
112 | |||
113 | return gfs2_ea_get_i(ip, er); | 92 | return gfs2_ea_get_i(ip, er); |
114 | } | 93 | } |
115 | 94 | ||
@@ -173,9 +152,6 @@ static int system_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
173 | static int security_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) | 152 | static int security_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) |
174 | { | 153 | { |
175 | struct inode *inode = &ip->i_inode; | 154 | struct inode *inode = &ip->i_inode; |
176 | int error = permission(inode, MAY_READ, NULL); | ||
177 | if (error) | ||
178 | return error; | ||
179 | 155 | ||
180 | return gfs2_ea_get_i(ip, er); | 156 | return gfs2_ea_get_i(ip, er); |
181 | } | 157 | } |
@@ -183,9 +159,6 @@ static int security_eo_get(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
183 | static int security_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er) | 159 | static int security_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er) |
184 | { | 160 | { |
185 | struct inode *inode = &ip->i_inode; | 161 | struct inode *inode = &ip->i_inode; |
186 | int error = permission(inode, MAY_WRITE, NULL); | ||
187 | if (error) | ||
188 | return error; | ||
189 | 162 | ||
190 | return gfs2_ea_set_i(ip, er); | 163 | return gfs2_ea_set_i(ip, er); |
191 | } | 164 | } |
@@ -193,9 +166,6 @@ static int security_eo_set(struct gfs2_inode *ip, struct gfs2_ea_request *er) | |||
193 | static int security_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er) | 166 | static int security_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er) |
194 | { | 167 | { |
195 | struct inode *inode = &ip->i_inode; | 168 | struct inode *inode = &ip->i_inode; |
196 | int error = permission(inode, MAY_WRITE, NULL); | ||
197 | if (error) | ||
198 | return error; | ||
199 | 169 | ||
200 | return gfs2_ea_remove_i(ip, er); | 170 | return gfs2_ea_remove_i(ip, er); |
201 | } | 171 | } |