summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMaciek Borzecki <maciek.borzecki@gmail.com>2021-04-06 18:02:29 +0300
committerSteve French <stfrench@microsoft.com>2021-04-08 05:30:27 +0300
commit0fc9322ab5e1fe6910c9673e1a7ff29f7dd72611 (patch)
tree7131cf24c813a94f10890d57606abaa2bc78c2af /fs
parentd135be0a7fb83f4dd68721b3355fec6de686834c (diff)
downloadlinux-0fc9322ab5e1fe6910c9673e1a7ff29f7dd72611.tar.xz
cifs: escape spaces in share names
Commit 653a5efb849a ("cifs: update super_operations to show_devname") introduced the display of devname for cifs mounts. However, when mounting a share which has a whitespace in the name, that exact share name is also displayed in mountinfo. Make sure that all whitespace is escaped. Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com> CC: <stable@vger.kernel.org> # 5.11+ Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifsfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 099ad9f3660b..5ddd20b62484 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -476,7 +476,8 @@ static int cifs_show_devname(struct seq_file *m, struct dentry *root)
seq_puts(m, "none");
else {
convert_delimiter(devname, '/');
- seq_puts(m, devname);
+ /* escape all spaces in share names */
+ seq_escape(m, devname, " \t");
kfree(devname);
}
return 0;