[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210412084016.848914696@linuxfoundation.org>
Date: Mon, 12 Apr 2021 10:38:50 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Maciek Borzecki <maciek.borzecki@...il.com>,
Shyam Prasad N <sprasad@...rosoft.com>,
Steve French <stfrench@...rosoft.com>
Subject: [PATCH 5.11 025/210] cifs: escape spaces in share names
From: Maciek Borzecki <maciek.borzecki@...il.com>
commit 0fc9322ab5e1fe6910c9673e1a7ff29f7dd72611 upstream.
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@...il.com>
CC: <stable@...r.kernel.org> # 5.11+
Reviewed-by: Shyam Prasad N <sprasad@...rosoft.com>
Signed-off-by: Steve French <stfrench@...rosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
fs/cifs/cifsfs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -475,7 +475,8 @@ static int cifs_show_devname(struct seq_
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;
Powered by blists - more mailing lists