aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2007-11-09 18:25:04 -0500
committerSteve French <sfrench@us.ibm.com>2007-11-09 18:25:04 -0500
commit9b8f5f573770f33b28c45255ac82e6457278c782 (patch)
tree1a15c5861fec57963a46356f2d276585e477c81c /fs
parenta6f8de3d9b124c95893054fd2a78bc7be5bb9000 (diff)
[CIFS] fix oops on second mount to same server when null auth is used
When a share is mounted using no username, cifs_mount sets volume_info.username as a NULL pointer, and the sesInfo userName as an empty string. The volume_info.username is passed to a couple of other functions to see if there is an existing unc or tcp connection that can be used. These functions assume that the username will be a valid string that can be passed to strncmp. If the pointer is NULL, then the kernel will oops if there's an existing session to which the string can be compared. This patch changes cifs_mount to set volume_info.username to an empty string in this situation, which prevents the oops and should make it so that the comparison to other null auth sessions match. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/CHANGES1
-rw-r--r--fs/cifs/connect.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 53629b8bc8a8..64dd22239b21 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -1,5 +1,6 @@
1Version 1.52 1Version 1.52
2------------ 2------------
3Fix oops on second mount to server when null auth is used.
3 4
4Version 1.51 5Version 1.51
5------------ 6------------
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 380ee9991f20..1102160f6661 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1790,7 +1790,7 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1790 1790
1791 if (volume_info.nullauth) { 1791 if (volume_info.nullauth) {
1792 cFYI(1, ("null user")); 1792 cFYI(1, ("null user"));
1793 volume_info.username = NULL; 1793 volume_info.username = "";
1794 } else if (volume_info.username) { 1794 } else if (volume_info.username) {
1795 /* BB fixme parse for domain name here */ 1795 /* BB fixme parse for domain name here */
1796 cFYI(1, ("Username: %s", volume_info.username)); 1796 cFYI(1, ("Username: %s", volume_info.username));