summaryrefslogtreecommitdiff
path: root/fs/cifs/cifsacl.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2012-12-10 15:10:44 +0400
committerSteve French <smfrench@gmail.com>2012-12-11 21:48:49 +0400
commit193cdd8a293007d1a1ad252cf66b2dc5b793d2d0 (patch)
tree2bfefe36dd1c6ca0d42fc35b00bf323b8d41e5b3 /fs/cifs/cifsacl.h
parent6d8b59d712e95d257ee16f80b579677e5e1bf33c (diff)
downloadlinux-193cdd8a293007d1a1ad252cf66b2dc5b793d2d0.tar.xz
cifs: fix SID binary to string conversion
The authority fields are supposed to be represented by a single 48-bit value. It's also supposed to represent the value as hex if it's equal to or greater than 2^32. This is documented in MS-DTYP, section 2.4.2.1. Also, fix up the max string length to account for this fix. Acked-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifsacl.h')
-rw-r--r--fs/cifs/cifsacl.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h
index a445405f80d0..4f3884835267 100644
--- a/fs/cifs/cifsacl.h
+++ b/fs/cifs/cifsacl.h
@@ -55,12 +55,14 @@
* u8: max 3 bytes in decimal
* u32: max 10 bytes in decimal
*
- * "S-" + 3 bytes for version field + 4 bytes for each authority field (3 bytes
- * per number + 1 for '-') + NULL terminator.
+ * "S-" + 3 bytes for version field + 15 for authority field + NULL terminator
+ *
+ * For authority field, max is when all 6 values are non-zero and it must be
+ * represented in hex. So "-0x" + 12 hex digits.
*
* Add 11 bytes for each subauthority field (10 bytes each + 1 for '-')
*/
-#define SID_STRING_BASE_SIZE (2 + 3 + (4 * NUM_AUTHS) + 1)
+#define SID_STRING_BASE_SIZE (2 + 3 + 15 + 1)
#define SID_STRING_SUBAUTH_SIZE (11) /* size of a single subauth string */
struct cifs_ntsd {