summaryrefslogtreecommitdiff
path: root/cifsacl.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@samba.org>2012-10-29 16:04:11 -0400
committerJeff Layton <jlayton@samba.org>2012-11-07 10:19:14 -0500
commitf0269e2a0efacf5299b123801d9ec49695ed30b6 (patch)
tree249c4aa0ddb0de55ddcef68d74fb5017d0205a3b /cifsacl.h
parentc49a6767051979368eea1087c9724a2c2994bd56 (diff)
downloadcifs-utils-f0269e2a0efacf5299b123801d9ec49695ed30b6.tar.gz
cifs-utils-f0269e2a0efacf5299b123801d9ec49695ed30b6.tar.bz2
cifs-utils-f0269e2a0efacf5299b123801d9ec49695ed30b6.zip
setcifsacl: clean up sizing of cifs_sid
The max number of subauthorities on windows and in winbind is generally 15, not 5. If winbind sends more than 5, then this code may end up overrunning the buffer. Also, define some preprocessor constants and use those instead of hardcoding '5' and '6' all over the place. Signed-off-by: Jeff Layton <jlayton@samba.org>
Diffstat (limited to 'cifsacl.h')
-rw-r--r--cifsacl.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/cifsacl.h b/cifsacl.h
index 101881b..f9fdc8f 100644
--- a/cifsacl.h
+++ b/cifsacl.h
@@ -96,6 +96,9 @@
#define COMPMASK 0x8
#define COMPALL 0xf /* COMPSID | COMPTYPE | COMPFLAG | COMPMASK */
+#define NUM_AUTHS (6) /* number of authority fields */
+#define SID_MAX_SUB_AUTHORITIES (15) /* max number of sub authority fields */
+
enum ace_action {
acedelete = 0,
acemodify,
@@ -115,8 +118,8 @@ struct cifs_ntsd {
struct cifs_sid {
uint8_t revision; /* revision level */
uint8_t num_subauth;
- uint8_t authority[6];
- uint32_t sub_auth[5]; /* sub_auth[num_subauth] */
+ uint8_t authority[NUM_AUTHS];
+ uint32_t sub_auth[SID_MAX_SUB_AUTHORITIES];
} __attribute__((packed));
struct cifs_ctrl_acl {