diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/cifsacl.c | 2 | ||||
-rw-r--r-- | fs/cifs/cifsacl.h | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index b0b114acdece..08b4d5022686 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
@@ -1008,7 +1008,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode, | |||
1008 | * memory for the smb header, set security descriptor request security | 1008 | * memory for the smb header, set security descriptor request security |
1009 | * descriptor parameters, and secuirty descriptor itself | 1009 | * descriptor parameters, and secuirty descriptor itself |
1010 | */ | 1010 | */ |
1011 | secdesclen = max_t(u32, secdesclen, DEFSECDESCLEN); | 1011 | secdesclen = max_t(u32, secdesclen, DEFAULT_SEC_DESC_LEN); |
1012 | pnntsd = kmalloc(secdesclen, GFP_KERNEL); | 1012 | pnntsd = kmalloc(secdesclen, GFP_KERNEL); |
1013 | if (!pnntsd) { | 1013 | if (!pnntsd) { |
1014 | cERROR(1, "Unable to allocate security descriptor"); | 1014 | cERROR(1, "Unable to allocate security descriptor"); |
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h index 46cd444ea2f2..a445405f80d0 100644 --- a/fs/cifs/cifsacl.h +++ b/fs/cifs/cifsacl.h | |||
@@ -25,9 +25,6 @@ | |||
25 | 25 | ||
26 | #define NUM_AUTHS (6) /* number of authority fields */ | 26 | #define NUM_AUTHS (6) /* number of authority fields */ |
27 | #define SID_MAX_SUB_AUTHORITIES (15) /* max number of sub authority fields */ | 27 | #define SID_MAX_SUB_AUTHORITIES (15) /* max number of sub authority fields */ |
28 | #define NUM_WK_SIDS 7 /* number of well known sids */ | ||
29 | #define SIDNAMELENGTH 20 /* long enough for the ones we care about */ | ||
30 | #define DEFSECDESCLEN 192 /* sec desc len contaiting a dacl with three aces */ | ||
31 | 28 | ||
32 | #define READ_BIT 0x4 | 29 | #define READ_BIT 0x4 |
33 | #define WRITE_BIT 0x2 | 30 | #define WRITE_BIT 0x2 |
@@ -43,6 +40,14 @@ | |||
43 | #define SIDGROUP 2 | 40 | #define SIDGROUP 2 |
44 | 41 | ||
45 | /* | 42 | /* |
43 | * Security Descriptor length containing DACL with 3 ACEs (one each for | ||
44 | * owner, group and world). | ||
45 | */ | ||
46 | #define DEFAULT_SEC_DESC_LEN (sizeof(struct cifs_ntsd) + \ | ||
47 | sizeof(struct cifs_acl) + \ | ||
48 | (sizeof(struct cifs_ace) * 3)) | ||
49 | |||
50 | /* | ||
46 | * Maximum size of a string representation of a SID: | 51 | * Maximum size of a string representation of a SID: |
47 | * | 52 | * |
48 | * The fields are unsigned values in decimal. So: | 53 | * The fields are unsigned values in decimal. So: |