Skip to content

Commit 0fc9322

Browse files
bboozzoosmfrench
authored andcommitted
cifs: escape spaces in share names
Commit 653a5ef ("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>
1 parent d135be0 commit 0fc9322

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/cifs/cifsfs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ static int cifs_show_devname(struct seq_file *m, struct dentry *root)
476476
seq_puts(m, "none");
477477
else {
478478
convert_delimiter(devname, '/');
479-
seq_puts(m, devname);
479+
/* escape all spaces in share names */
480+
seq_escape(m, devname, " \t");
480481
kfree(devname);
481482
}
482483
return 0;

0 commit comments

Comments
 (0)