diff options
author | Steve French <sfrench@us.ibm.com> | 2006-10-30 21:46:13 +0000 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2006-10-30 21:46:13 +0000 |
commit | 4b952a9b0877dbe8f0f69b2747abe79e3bbd2865 (patch) | |
tree | 63d933c2d6e4694da7f81d173f75a679a5874d15 /fs/cifs/connect.c | |
parent | 7ca85ba752e521f1b5ead1f3b91c562cc3910c7b (diff) | |
download | op-kernel-dev-4b952a9b0877dbe8f0f69b2747abe79e3bbd2865.zip op-kernel-dev-4b952a9b0877dbe8f0f69b2747abe79e3bbd2865.tar.gz |
[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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 4093d53..71f7791 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) } else if (strnicmp(data, "nouser_xattr",12) == 0) { vol->no_xattr = 1; } else if (strnicmp(data, "user", 4) == 0) { - if (!value || !*value) { + if (!value) { printk(KERN_WARNING "CIFS: invalid or missing username\n"); return 1; /* needs_arg; */ + } else if(!*value) { + /* null user, ie anonymous, authentication */ + vol->nullauth = 1; } if (strnlen(value, 200) < 200) { vol->username = value; @@ -1642,6 +1645,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, /* BB fixme parse for domain name here */ cFYI(1, ("Username: %s ", volume_info.username)); + } else if (volume_info.nullauth) { + cFYI(1,("null user")); } else { cifserror("No username specified"); /* In userspace mount helper we can get user name from alternate |