Maximum password length check too short in mount.cifs
[sfrench/samba-autobuild/.git] / source3 / client / mount.cifs.c
index 8623d3c04b537d3022f23b62e2da3aaca40f29ef..a5d99dc3d918dc53c17b48f6463efb998b70a128 100644 (file)
@@ -77,7 +77,7 @@
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
 #endif
 
-#define MOUNT_PASSWD_SIZE 64
+#define MOUNT_PASSWD_SIZE 128
 #define DOMAIN_SIZE 64
 
 /* currently maximum length of IPv6 address string */
@@ -473,7 +473,7 @@ static int parse_options(char ** optionsp, int * filesys_flags)
                                        printf("\npassword specified twice, ignoring second\n");
                                } else
                                        got_password = 1;
-                       } else if (strnlen(value, 17) < 17) {
+                       } else if (strnlen(value, MOUNT_PASSWD_SIZE) < MOUNT_PASSWD_SIZE) {
                                if(got_password)
                                        printf("\nmount.cifs warning - password specified twice\n");
                                got_password = 1;
@@ -1463,7 +1463,8 @@ mount_retry:
                        }
                }
                printf("mount error(%d): %s\n", errno, strerror(errno));
-               printf("Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)\n");
+               printf("Refer to the mount.cifs(8) manual page (e.g. man "
+                      "mount.cifs)\n");
                rc = EX_FAIL;
                goto mount_exit;
        }