All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs-utils: Correct max string lengths
@ 2013-07-19 21:26 scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
       [not found] ` <1374269172-4964-1-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w @ 2013-07-19 21:26 UTC (permalink / raw)
  To: jlayton-H+wXaHxf7aLQT0dZR+AlfA
  Cc: Scott Lovenberg, gang.chen-bOixZGp5f+dBDgjK7y7TUQ,
	sfrench-eUNUBHrolfbYtjvyW6yDsg,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

From: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

The max size of the username, domain, password and share name strings
are now consistent with the kernel and Microsoft's documentation.

Signed-off-by: Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 AUTHORS      |  2 ++
 mount.cifs.c | 27 ++++++++++++++++++---------
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 2807079..2f6a14d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -5,5 +5,7 @@ Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
 Suresh Jayaraman <sjayaraman-l3A5Bk7waGM@public.gmane.org>
 Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
 Igor Druzhinin <jaxbrigs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+Scott Lovenberg <scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
+
 
 ...and others.
diff --git a/mount.cifs.c b/mount.cifs.c
index 3b2b89e..8d975b3 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -83,22 +83,31 @@
 /* max length of mtab options */
 #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. 
  */
-#define MAX_SHARE_LEN 256
 
-/* max length of username (somewhat made up here) */
-#define MAX_USERNAME_SIZE 32
+/* Max length of the share name portion of a UNC.  According to Microsoft 
+ * this is correct for Windows 2000/XP. */
+#define MAX_SHARE_LEN 80
+
+/* 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
-- 
1.8.1.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-07-22 15:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-19 21:26 [PATCH] cifs-utils: Correct max string lengths scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w
     [not found] ` <1374269172-4964-1-git-send-email-scott.lovenberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-19 21:51   ` Steve French
     [not found]     ` <CAH2r5msAt8ZuXYdNzufB3BOah7f2ywyi3EgbS14ahESWe1BMRw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-19 21:52       ` Steve French
2013-07-19 22:19       ` Scott Lovenberg
2013-07-20  2:34         ` Steve French
2013-07-20  2:44           ` Scott Lovenberg
     [not found]             ` <8FB3EB95-C367-4DE7-935C-37C7295F7D53-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-20 10:43               ` Jeff Layton
     [not found]                 ` <20130720064344.42d73b04-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-07-20 15:24                   ` Scott Lovenberg
     [not found]                     ` <6D61AEAF-9EE2-4F99-BA76-F186A76312E0-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-22  1:38                       ` Chen Gang
2013-07-22 10:53                         ` Jeff Layton
     [not found]                           ` <20130722065317.11cd4ffd-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2013-07-22 15:07                             ` Scott Lovenberg
     [not found]                               ` <CAFB9KM1XE0hw5yFjyL0DP_6MHCYgXqtKPySTgWV1xpX+J9f6Jg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-22 15:12                                 ` Jeff Layton
     [not found]                                   ` <20130722111258.1ac02e22-9yPaYZwiELC+kQycOl6kW4xkIHaj4LzF@public.gmane.org>
2013-07-22 15:30                                     ` Scott Lovenberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.