diff options
Diffstat (limited to 'fs/cifs/cifsacl.c')
-rw-r--r-- | fs/cifs/cifsacl.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index a437ec391a01..beeebf194234 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -41,9 +41,12 @@ static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { | |||
41 | ; | 41 | ; |
42 | 42 | ||
43 | 43 | ||
44 | /* security id for everyone */ | 44 | /* security id for everyone/world system group */ |
45 | static const struct cifs_sid sid_everyone = { | 45 | static const struct cifs_sid sid_everyone = { |
46 | 1, 1, {0, 0, 0, 0, 0, 1}, {0} }; | 46 | 1, 1, {0, 0, 0, 0, 0, 1}, {0} }; |
47 | /* security id for Authenticated Users system group */ | ||
48 | static const struct cifs_sid sid_authusers = { | ||
49 | 1, 1, {0, 0, 0, 0, 0, 5}, {11} }; | ||
47 | /* group users */ | 50 | /* group users */ |
48 | static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; | 51 | static const struct cifs_sid sid_user = {1, 2 , {0, 0, 0, 0, 0, 5}, {} }; |
49 | 52 | ||
@@ -365,10 +368,14 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, | |||
365 | if (num_aces > 0) { | 368 | if (num_aces > 0) { |
366 | umode_t user_mask = S_IRWXU; | 369 | umode_t user_mask = S_IRWXU; |
367 | umode_t group_mask = S_IRWXG; | 370 | umode_t group_mask = S_IRWXG; |
368 | umode_t other_mask = S_IRWXO; | 371 | umode_t other_mask = S_IRWXU | S_IRWXG | S_IRWXO; |
369 | 372 | ||
370 | ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), | 373 | ppace = kmalloc(num_aces * sizeof(struct cifs_ace *), |
371 | GFP_KERNEL); | 374 | GFP_KERNEL); |
375 | if (!ppace) { | ||
376 | cERROR(1, "DACL memory allocation error"); | ||
377 | return; | ||
378 | } | ||
372 | 379 | ||
373 | for (i = 0; i < num_aces; ++i) { | 380 | for (i = 0; i < num_aces; ++i) { |
374 | ppace[i] = (struct cifs_ace *) (acl_base + acl_size); | 381 | ppace[i] = (struct cifs_ace *) (acl_base + acl_size); |
@@ -390,6 +397,12 @@ static void parse_dacl(struct cifs_acl *pdacl, char *end_of_acl, | |||
390 | ppace[i]->type, | 397 | ppace[i]->type, |
391 | &fattr->cf_mode, | 398 | &fattr->cf_mode, |
392 | &other_mask); | 399 | &other_mask); |
400 | if (compare_sids(&(ppace[i]->sid), &sid_authusers)) | ||
401 | access_flags_to_mode(ppace[i]->access_req, | ||
402 | ppace[i]->type, | ||
403 | &fattr->cf_mode, | ||
404 | &other_mask); | ||
405 | |||
393 | 406 | ||
394 | /* memcpy((void *)(&(cifscred->aces[i])), | 407 | /* memcpy((void *)(&(cifscred->aces[i])), |
395 | (void *)ppace[i], | 408 | (void *)ppace[i], |