diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsacl.c | 21 | ||||
-rw-r--r-- | fs/cifs/cifsacl.h | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index 14200bd45b30..3a2d67b182d4 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -134,14 +134,29 @@ int compare_sids(const struct cifs_sid *ctsid, const struct cifs_sid *cwsid) | |||
134 | pmode is the existing mode (we only want to overwrite part of this | 134 | pmode is the existing mode (we only want to overwrite part of this |
135 | bits to set can be: S_IRWXU, S_IRWXG or S_IRWXO ie 00700 or 00070 or 00007 | 135 | bits to set can be: S_IRWXU, S_IRWXG or S_IRWXO ie 00700 or 00070 or 00007 |
136 | */ | 136 | */ |
137 | static void access_flags_to_mode(__u32 access_flags, umode_t * pmode, | 137 | static void access_flags_to_mode(__u32 ace_flags, umode_t *pmode, |
138 | umode_t bits_to_set) | 138 | umode_t bits_to_set) |
139 | { | 139 | { |
140 | 140 | ||
141 | *pmode &= ~bits_to_set; | ||
142 | |||
143 | if (ace_flags & GENERIC_ALL) { | ||
144 | *pmode |= (S_IRWXUGO & bits_to_set); | ||
141 | #ifdef CONFIG_CIFS_DEBUG2 | 145 | #ifdef CONFIG_CIFS_DEBUG2 |
142 | cFYI(1, ("access flags 0x%x mode now 0x%x", access_flags, *pmode); | 146 | cFYI(1, ("all perms")); |
143 | #endif | 147 | #endif |
148 | return; | ||
149 | } | ||
150 | if ((ace_flags & GENERIC_WRITE) || (ace_flags & FILE_WRITE_RIGHTS)) | ||
151 | *pmode |= (S_IWUGO & bits_to_set); | ||
152 | if ((ace_flags & GENERIC_READ) || (ace_flags & FILE_READ_RIGHTS)) | ||
153 | *pmode |= (S_IRUGO & bits_to_set); | ||
154 | if ((ace_flags & GENERIC_EXECUTE) || (ace_flags & FILE_EXEC_RIGHTS)) | ||
155 | *pmode |= (S_IXUGO & bits_to_set); | ||
144 | 156 | ||
157 | #ifdef CONFIG_CIFS_DEBUG2 | ||
158 | cFYI(1, ("access flags 0x%x mode now 0x%x", ace_flags, *pmode); | ||
159 | #endif | ||
145 | return; | 160 | return; |
146 | } | 161 | } |
147 | 162 | ||
@@ -242,7 +257,7 @@ static void parse_ace(struct cifs_ace *pace, char *end_of_acl) | |||
242 | 257 | ||
243 | 258 | ||
244 | static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, | 259 | static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, |
245 | struct cifs_sid *pownersid, struct cifs_sid *pgrpsid | 260 | struct cifs_sid *pownersid, struct cifs_sid *pgrpsid, |
246 | struct inode *inode) | 261 | struct inode *inode) |
247 | { | 262 | { |
248 | int i; | 263 | int i; |
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h index 06d52006bf26..30b0caf66786 100644 --- a/fs/cifs/cifsacl.h +++ b/fs/cifs/cifsacl.h | |||
@@ -73,7 +73,7 @@ struct cifs_wksid { | |||
73 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 73 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
74 | 74 | ||
75 | extern int match_sid(struct cifs_sid *); | 75 | extern int match_sid(struct cifs_sid *); |
76 | extern int compare_sids(struct cifs_sid *, struct cifs_sid *); | 76 | extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *); |
77 | 77 | ||
78 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 78 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ |
79 | 79 | ||