Re: [PATCH 4.9-5.8] Convert trailing spaces and periods in path components

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I could not find the patch in Linus's tree at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/cifs/cifs_unicode.c#n491 or in the commit list. The patch is in linux-next, commit https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=7698a46ed868f03afe1871d7cb63061db6a62b71

On 10/18/20, 1:56 AM, "Greg KH" <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:

    CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.



    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@xxxxxxxxxxxxxxx> # 4.9.x-5.8.x
    > Signed-off-by: Boris Protopopov <pboris@xxxxxxxxxx>
    > ---
    >  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





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux