CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option
authorSteve French <smfrench@gmail.com>
Mon, 23 Jun 2014 01:38:49 +0000 (20:38 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 17:51:20 +0000 (10:51 -0700)
commit6e44d311e993f364bbf4d99e2b6beac25f03bdbe
treec5724d189dcfeac65ef397e4d97300eba5fb45f2
parent74be85d10748a196626d8c0e531c75c11d26ad95
CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option

commit ce36d9ab3bab06b7b5522f5c8b68fac231b76ffb upstream.

When we SMB3 mounted with mapchars (to allow reserved characters : \ / > < * ?
via the Unicode Windows to POSIX remap range) empty paths
(eg when we open "" to query the root of the SMB3 directory on mount) were not
null terminated so we sent garbarge as a path name on empty paths which caused
SMB2/SMB2.1/SMB3 mounts to fail when mapchars was specified.  mapchars is
particularly important since Unix Extensions for SMB3 are not supported (yet)

Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/cifs_unicode.c