aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-10-26 00:32:43 -0400
committerSteve French <sfrench@us.ibm.com>2007-10-26 00:32:43 -0400
commitd61e5808d9a4e7c7f25914ceae50664a6454c3ca (patch)
tree52bce32e78f301cc5a616d32e8af2a8dd6715d3a
parent630f3f0c45a80ab907d216191ef4a205c249fa1b (diff)
[CIFS] acl support part 7
Also fixes typo, build break Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/cifsacl.c21
-rw-r--r--fs/cifs/cifsacl.h2
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*/
137static void access_flags_to_mode(__u32 access_flags, umode_t * pmode, 137static 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
244static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, 259static 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
75extern int match_sid(struct cifs_sid *); 75extern int match_sid(struct cifs_sid *);
76extern int compare_sids(struct cifs_sid *, struct cifs_sid *); 76extern 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