diff options
author | Sachin Prabhu <sprabhu@redhat.com> | 2012-09-19 09:22:45 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:34 -0400 |
commit | ecdb69e2cc80cca77d6afcc0aca244b72cc5ee68 (patch) | |
tree | 050776ac0f5f656b9223c71eb07ade0e9e750bd5 /fs/cifs | |
parent | 101b92d9590a645d6fb643654b3a92556203b745 (diff) |
cifs: Mangle string used for unc in /proc/mounts
The string for "unc=" in /proc/mounts needs to be escaped. The current
behaviour can create problems in cases when mounting a share starting
with a number.
example:
>mount -t cifs -o username=test,password=x vm140-31:/17000-test /mnt
>mount -o remount,password=x /mnt
mount error: could not resolve address for vm140-31x00-test: Unknown
error
The sub-string "\170" which is part of the unc for the mount above in
/proc/mounts is interpreted as character'x' in the case above. Escaping
the string fixes the problem.
Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 28ac048d54ea..a41044a31083 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -350,7 +350,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root) | |||
350 | cifs_show_security(s, tcon->ses->server); | 350 | cifs_show_security(s, tcon->ses->server); |
351 | cifs_show_cache_flavor(s, cifs_sb); | 351 | cifs_show_cache_flavor(s, cifs_sb); |
352 | 352 | ||
353 | seq_printf(s, ",unc=%s", tcon->treeName); | 353 | seq_printf(s, ",unc="); |
354 | seq_escape(s, tcon->treeName, " \t\n\\"); | ||
354 | 355 | ||
355 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) | 356 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) |
356 | seq_printf(s, ",multiuser"); | 357 | seq_printf(s, ",multiuser"); |