stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Boris Protopopov <pboris@amazon.com>
Cc: stable <stable@vger.kernel.org>
Subject: Re: [PATCH 4.9-5.8] Convert trailing spaces and periods in path components
Date: Sun, 18 Oct 2020 07:55:19 +0200	[thread overview]
Message-ID: <20201018055519.GB599591@kroah.com> (raw)
In-Reply-To: <20201017152839.4398-1-pboris@amazon.com>

On Sat, Oct 17, 2020 at 03:28:39PM +0000, Boris Protopopov wrote:
> When converting trailing spaces and periods in paths, do so
> for every component of the path, not just the last component.
> If the conversion is not done for every path component, then
> subsequent operations in directories with trailing spaces or
> periods (e.g. create(), mkdir()) will fail with ENOENT. This
> is because on the server, the directory will have a special
> symbol in its name, and the client needs to provide the same.
> 
> Cc: <stable@vger.kernel.org> # 4.9.x-5.8.x
> Signed-off-by: Boris Protopopov <pboris@amazon.com>
> ---
>  fs/cifs/cifs_unicode.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
> index 498777d859eb..9bd03a231032 100644
> --- a/fs/cifs/cifs_unicode.c
> +++ b/fs/cifs/cifs_unicode.c
> @@ -488,7 +488,13 @@ cifsConvertToUTF16(__le16 *target, const char *source, int srclen,
>  		else if (map_chars == SFM_MAP_UNI_RSVD) {
>  			bool end_of_string;
>  
> -			if (i == srclen - 1)
> +			/**
> +			 * Remap spaces and periods found at the end of every
> +			 * component of the path. The special cases of '.' and
> +			 * '..' do not need to be dealt with explicitly because
> +			 * they are addressed in namei.c:link_path_walk().
> +			 **/
> +			if ((i == srclen - 1) || (source[i+1] == '\\'))
>  				end_of_string = true;
>  			else
>  				end_of_string = false;
> -- 
> 2.18.4
> 

What is the git commit id of this in Linus's tree?

thanks,

greg k-h

  reply	other threads:[~2020-10-18  5:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 15:28 [PATCH 4.9-5.8] Convert trailing spaces and periods in path components Boris Protopopov
2020-10-18  5:55 ` Greg KH [this message]
2020-10-19 14:17   ` Protopopov, Boris
2020-10-19 17:43     ` Greg KH
2020-10-19 18:10       ` Protopopov, Boris
  -- strict thread matches above, loose matches on Subject: below --
2020-10-16 19:22 Boris Protopopov
2020-10-17  6:20 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201018055519.GB599591@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=pboris@amazon.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).