[CIFS] Allow null user connections

Some servers are configured to only allow null user mounts for
guest access. Allow nul user (anonymous) mounts e.g.
mount -t cifs //server/share /mnt -o username=

Signed-off-by: Steve French <sfrench@us.ibm.com>

+9 -1
+3
fs/cifs/CHANGES
··· 1 Version 1.46 2 ------------ 3 Support deep tree mounts. Better support OS/2, Win9x (DOS) time stamps. 4 5 Version 1.45 6 ------------
··· 1 Version 1.46 2 ------------ 3 Support deep tree mounts. Better support OS/2, Win9x (DOS) time stamps. 4 + Allow null user to be specified on mount ("username="). Do not return 5 + EINVAL on readdir when filldir fails due to overwritten blocksize 6 + (fixes FC problem) 7 8 Version 1.45 9 ------------
+6 -1
fs/cifs/connect.c
··· 822 } else if (strnicmp(data, "nouser_xattr",12) == 0) { 823 vol->no_xattr = 1; 824 } else if (strnicmp(data, "user", 4) == 0) { 825 - if (!value || !*value) { 826 printk(KERN_WARNING 827 "CIFS: invalid or missing username\n"); 828 return 1; /* needs_arg; */ 829 } 830 if (strnlen(value, 200) < 200) { 831 vol->username = value; ··· 1645 /* BB fixme parse for domain name here */ 1646 cFYI(1, ("Username: %s ", volume_info.username)); 1647 1648 } else { 1649 cifserror("No username specified"); 1650 /* In userspace mount helper we can get user name from alternate
··· 822 } else if (strnicmp(data, "nouser_xattr",12) == 0) { 823 vol->no_xattr = 1; 824 } else if (strnicmp(data, "user", 4) == 0) { 825 + if (!value) { 826 printk(KERN_WARNING 827 "CIFS: invalid or missing username\n"); 828 return 1; /* needs_arg; */ 829 + } else if(!*value) { 830 + /* null user, ie anonymous, authentication */ 831 + vol->nullauth = 1; 832 } 833 if (strnlen(value, 200) < 200) { 834 vol->username = value; ··· 1642 /* BB fixme parse for domain name here */ 1643 cFYI(1, ("Username: %s ", volume_info.username)); 1644 1645 + } else if (volume_info.nullauth) { 1646 + cFYI(1,("null user")); 1647 } else { 1648 cifserror("No username specified"); 1649 /* In userspace mount helper we can get user name from alternate