diff options
author | Scott Lovenberg <scott.lovenberg@gmail.com> | 2013-07-21 16:21:08 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2013-07-22 08:09:44 -0400 |
commit | 3ec619fce9abaa37edd4540840913682d48c5359 (patch) | |
tree | 1226ac0c1cd9b46892771dc5310419ab329f08b6 | |
parent | e18d42adddbea9178d93b6051132f9cdee4cc9e0 (diff) | |
download | cifs-utils-3ec619fce9abaa37edd4540840913682d48c5359.tar.gz cifs-utils-3ec619fce9abaa37edd4540840913682d48c5359.tar.bz2 cifs-utils-3ec619fce9abaa37edd4540840913682d48c5359.zip |
cifs-utils: Correct max string lengths v2
The max size of the username, domain, and password strings are now
consistent with the kernel and Microsoft's documentation.
Signed-off-by: Scott Lovenberg <scott.lovenberg@gmail.com>
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | mount.cifs.c | 23 |
2 files changed, 17 insertions, 7 deletions
@@ -5,5 +5,6 @@ Shirish Pargaonkar <shirishpargaonkar@gmail.com> Suresh Jayaraman <sjayaraman@suse.de> Pavel Shilovsky <piastry@etersoft.ru> Igor Druzhinin <jaxbrigs@gmail.com> +Scott Lovenberg <scott.lovenberg@gmail.com> ...and others. diff --git a/mount.cifs.c b/mount.cifs.c index 12f1b8e..e76beee 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -84,21 +84,30 @@ #define MTAB_OPTIONS_LEN 220 /* - * Maximum length of "share" portion of a UNC. I have no idea if this is at - * all valid. According to MSDN, the typical max length of any component is - * 255, so use that here. + * Max share name, username, password and domain sizes match the kernel's + * allowances for these string sizes which in turn match Microsoft's + * documentation. */ + +/* Max length of the share name portion of a UNC. Share names over 80 + * characters cannot be accessed via commandline in Windows 2000/XP. */ #define MAX_SHARE_LEN 256 -/* max length of username (somewhat made up here) */ -#define MAX_USERNAME_SIZE 32 +/* Max user name length. */ +#define MAX_USERNAME_SIZE 256 + +/* Max domain size. */ +#define MAX_DOMAIN_SIZE 256 + +/* Max password size. */ +#define MOUNT_PASSWD_SIZE 512 + + #ifndef SAFE_FREE #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x = NULL; } } while (0) #endif -#define MOUNT_PASSWD_SIZE 128 -#define MAX_DOMAIN_SIZE 64 /* * mount.cifs has been the subject of many "security" bugs that have arisen |