aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-10-30 16:46:13 -0500
committerSteve French <sfrench@us.ibm.com>2006-10-30 16:46:13 -0500
commit4b952a9b0877dbe8f0f69b2747abe79e3bbd2865 (patch)
tree63d933c2d6e4694da7f81d173f75a679a5874d15 /fs/cifs/connect.c
parent7ca85ba752e521f1b5ead1f3b91c562cc3910c7b (diff)
[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>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 4093d5332930..71f77914ce93 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -822,10 +822,13 @@ cifs_parse_mount_options(char *options, const char *devname,struct smb_vol *vol)
822 } else if (strnicmp(data, "nouser_xattr",12) == 0) { 822 } else if (strnicmp(data, "nouser_xattr",12) == 0) {
823 vol->no_xattr = 1; 823 vol->no_xattr = 1;
824 } else if (strnicmp(data, "user", 4) == 0) { 824 } else if (strnicmp(data, "user", 4) == 0) {
825 if (!value || !*value) { 825 if (!value) {
826 printk(KERN_WARNING 826 printk(KERN_WARNING
827 "CIFS: invalid or missing username\n"); 827 "CIFS: invalid or missing username\n");
828 return 1; /* needs_arg; */ 828 return 1; /* needs_arg; */
829 } else if(!*value) {
830 /* null user, ie anonymous, authentication */
831 vol->nullauth = 1;
829 } 832 }
830 if (strnlen(value, 200) < 200) { 833 if (strnlen(value, 200) < 200) {
831 vol->username = value; 834 vol->username = value;
@@ -1642,6 +1645,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1642 /* BB fixme parse for domain name here */ 1645 /* BB fixme parse for domain name here */
1643 cFYI(1, ("Username: %s ", volume_info.username)); 1646 cFYI(1, ("Username: %s ", volume_info.username));
1644 1647
1648 } else if (volume_info.nullauth) {
1649 cFYI(1,("null user"));
1645 } else { 1650 } else {
1646 cifserror("No username specified"); 1651 cifserror("No username specified");
1647 /* In userspace mount helper we can get user name from alternate 1652 /* In userspace mount helper we can get user name from alternate