]> git.karo-electronics.de Git - karo-tx-linux.git/commit
CIFS: make sure that DFS pathnames are properly formed
authorSteve French <sfrench@us.ibm.com>
Thu, 18 Dec 2008 01:41:20 +0000 (01:41 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 18 Jan 2009 18:43:44 +0000 (10:43 -0800)
commita94b68d6dcb74563d07c6eaf3f4b1191d0171e19
treeea19513f7caad2333984f6a865192b9c9853a45f
parente9c2a0a5a7a403f7fe12371fbe952f5aee61add4
CIFS: make sure that DFS pathnames are properly formed

commit c6fbba0546d3ead18d4a623e76e28bcbaa66a325 upstream.

The paths in a DFS request are supposed to only have a single preceding
backslash, but we are sending them with a double backslash. This is
exposing a bug in Windows where it also sends a path in the response
that has a double backslash.

The existing code that builds the mount option string however expects a
double backslash prefix in a couple of places when it tries to use the
path returned by build_path_from_dentry. Fix compose_mount_options to
expect properly formed DFS paths (single backslash at front).

Also clean up error handling in that function. There was a possible
NULL pointer dereference and situations where a partially built option
string would be returned.

Tested against Samba 3.0.28-ish server and Samba 3.3 and Win2k8.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifs_dfs_ref.c