aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsacl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsacl.c')
-rw-r--r--fs/cifs/cifsacl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index c46f26bcd8b2..ecd6da9e9d38 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -95,23 +95,24 @@ int match_sid(struct cifs_sid *ctsid)
95 return (-1); 95 return (-1);
96} 96}
97 97
98 98/* if the two SIDs (roughly equivalent to a UUID for a user or group) are
99 the same returns 1, if they do not match returns 0 */
99int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid) 100int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
100{ 101{
101 int i; 102 int i;
102 int num_subauth, num_sat, num_saw; 103 int num_subauth, num_sat, num_saw;
103 104
104 if ((!ctsid) || (!cwsid)) 105 if ((!ctsid) || (!cwsid))
105 return (-1); 106 return (0);
106 107
107 /* compare the revision */ 108 /* compare the revision */
108 if (ctsid->revision != cwsid->revision) 109 if (ctsid->revision != cwsid->revision)
109 return (-1); 110 return (0);
110 111
111 /* compare all of the six auth values */ 112 /* compare all of the six auth values */
112 for (i = 0; i < 6; ++i) { 113 for (i = 0; i < 6; ++i) {
113 if (ctsid->authority[i] != cwsid->authority[i]) 114 if (ctsid->authority[i] != cwsid->authority[i])
114 return (-1); 115 return (0);
115 } 116 }
116 117
117 /* compare all of the subauth values if any */ 118 /* compare all of the subauth values if any */
@@ -121,11 +122,11 @@ int compare_sids(struct cifs_sid *ctsid, struct cifs_sid *cwsid)
121 if (num_subauth) { 122 if (num_subauth) {
122 for (i = 0; i < num_subauth; ++i) { 123 for (i = 0; i < num_subauth; ++i) {
123 if (ctsid->sub_auth[i] != cwsid->sub_auth[i]) 124 if (ctsid->sub_auth[i] != cwsid->sub_auth[i])
124 return (-1); 125 return (0);
125 } 126 }
126 } 127 }
127 128
128 return (0); /* sids compare/match */ 129 return (1); /* sids compare/match */
129} 130}
130 131
131 132
@@ -180,7 +181,8 @@ static void parse_ntace(struct cifs_ntace *pntace, char *end_of_acl)
180 181
181 182
182 183
183static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl) 184static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl,
185 struct cifs_sid *pownersid, struct cifs_sid pgrpsid)
184{ 186{
185 int i; 187 int i;
186 int num_aces = 0; 188 int num_aces = 0;
@@ -219,7 +221,6 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl)
219 cifscred->aces = kmalloc(num_aces * 221 cifscred->aces = kmalloc(num_aces *
220 sizeof(struct cifs_ace *), GFP_KERNEL);*/ 222 sizeof(struct cifs_ace *), GFP_KERNEL);*/
221 223
222
223 for (i = 0; i < num_aces; ++i) { 224 for (i = 0; i < num_aces; ++i) {
224 ppntace[i] = (struct cifs_ntace *) 225 ppntace[i] = (struct cifs_ntace *)
225 (acl_base + acl_size); 226 (acl_base + acl_size);
@@ -317,7 +318,7 @@ int parse_sec_desc(struct cifs_ntsd *pntsd, int acl_len)
317 if (rc) 318 if (rc)
318 return rc; 319 return rc;
319 320
320 parse_dacl(dacl_ptr, end_of_acl); 321 parse_dacl(dacl_ptr, end_of_acl, owner_sid_ptr, group_sid_ptr);
321 322
322/* cifscred->uid = owner_sid_ptr->rid; 323/* cifscred->uid = owner_sid_ptr->rid;
323 cifscred->gid = group_sid_ptr->rid; 324 cifscred->gid = group_sid_ptr->rid;