cifs: Mangle string used for unc in /proc/mounts
Subsystems (2)
PATCH 1/1 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:
Quoted 2 lines
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.
--- fs/cifs/cifsfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/cifs/cifsfs.c +2 -1
@@ -360,7 +360,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)cifs_show_security (s, tcon->ses->server);cifs_show_cache_flavor (s, cifs_sb); -seq_printf (s,",unc=%s" , tcon->treeName); +seq_printf (s,",unc=" ); +seq_escape (s, tcon->treeName," \t\n\\" );if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MULTIUSER )seq_printf (s,",multiuser" );
Signature · 1 line
1.7.11.4
A message that is not in the archive (sent off-list or not yet received): 1347554937-28369-1-git-send-email-sprabhu-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Jeff Layton
Reviewed-byQuoted 24 lines · On Thu, 13 Sep 2012 17:48:57 +0100 Sachin Prabhu…
The string for "unc=" in
/proc/mountsneeds to be escaped. The current behaviour can create problems in cases when mounting a share starting with a number.example:
Quoted 2 lines
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/mountsis interpreted as character'x' in the case above. Escaping the string fixes the problem.Signed-off-by Sachin Prabhu <[email protected]>--- fs/cifs/cifsfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/cifs/cifsfs.c +0
-0
fs/cifs/cifsfs.c cifs_show_options(struct seq_file *s, struct dentry *root) · line 367
Quoted 9 lines
fs/cifs/cifsfs.c +2
-1@@ -360,7 +360,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)cifs_show_security (s, tcon->ses->server);cifs_show_cache_flavor (s, cifs_sb); -seq_printf (s,",unc=%s" , tcon->treeName); +seq_printf (s,",unc=" ); +seq_escape (s, tcon->treeName," \t\n\\" );if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MULTIUSER )seq_printf (s,",multiuser" );
A message that is not in the archive (sent off-list or not yet received): CAH2r5mvnV9xDAF8N5VocRYOy4aUCafNrKe1ykmz--rJQtU33Bg@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): CAH2r5mvnV9xDAF8N5VocRYOy4aUCafNrKe1ykmz--rJQtU33Bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Steve French
AppliedPATCH 1/1 cifs: Mangle string used for unc in /proc/mounts
---------- Forwarded message ----------
From: Steve French <[email protected]>
Date: Sat, Sep 15, 2012 at 3:52 PM
Subject: Re: [PATCH] cifs: Mangle string used for unc in /proc/mounts
To: Sachin Prabhu <[email protected]>
Cc: linux-cifs <[email protected]>, Jeff Layton <[email protected]>
merged into cifs-2.6.git
Quoted 35 lines · Sachin Prabhu
The string for "unc=" in
/proc/mountsneeds to be escaped. The current behaviour can create problems in cases when mounting a share starting with a number.example:
Quoted 2 lines
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/mountsis interpreted as character'x' in the case above. Escaping the string fixes the problem.Signed-off-by Sachin Prabhu <[email protected]>--- fs/cifs/cifsfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)fs/cifs/cifsfs.c +2
-1@@ -360,7 +360,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)cifs_show_security (s, tcon->ses->server);cifs_show_cache_flavor (s, cifs_sb); -seq_printf (s,",unc=%s" , tcon->treeName); +seq_printf (s,",unc=" ); +seq_escape (s, tcon->treeName," \t\n\\" );if (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_MULTIUSER )seq_printf(s, ",multiuser");
Quoted 3 lines
--
1.7.11.4
--
Thanks,
Steve
--
Thanks,
Steve