[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH2r5msOOnnaD7PSmPQNwppsiRPRyhmZ1StYp+kGoEyV6tCScA@mail.gmail.com>
Date: Wed, 7 Apr 2021 13:56:01 -0500
From: Steve French <smfrench@...il.com>
To: Maciek Borzecki <maciek.borzecki@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
CIFS <linux-cifs@...r.kernel.org>,
Steve French <sfrench@...ba.org>
Subject: Re: [PATCH] cifs: escape spaces in share names
Good catch - added one other minor thing, whitespace in share name
could be a space or a tab, so changed that line to:
+ seq_escape(m, devname, " \t");
from
+ seq_escape(m, devname, " ");
On Wed, Apr 7, 2021 at 12:35 AM Maciek Borzecki
<maciek.borzecki@...il.com> wrote:
>
> 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>
> ---
> fs/cifs/cifsfs.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> index 099ad9f3660bb28db1b6a9aea9538282b41c6455..3c6cb85b95e207df222248f10cc9df937cdda24e 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, " ");
> kfree(devname);
> }
> return 0;
> --
> 2.31.1
>
--
Thanks,
Steve
View attachment "0001-cifs-escape-spaces-in-share-names.patch" of type "text/x-patch" (1218 bytes)
Powered by blists - more mailing lists