Skip to content

Commit

Permalink
cifs: escape spaces in share names
Browse files Browse the repository at this point in the history
commit 0fc9322 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
bboozzoo authored and gregkh committed Apr 14, 2021
1 parent 2b11196 commit dc3b032
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/cifs/cifsfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,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;
Expand Down

0 comments on commit dc3b032

Please sign in to comment.