From: Greg Kroah-Hartman Date: Tue, 17 Nov 2020 12:19:05 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.244~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d967bb8bbe981e57ec585c0db237671e42dd5039;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: convert-trailing-spaces-and-periods-in-path-components.patch --- diff --git a/queue-4.14/convert-trailing-spaces-and-periods-in-path-components.patch b/queue-4.14/convert-trailing-spaces-and-periods-in-path-components.patch new file mode 100644 index 00000000000..f064fe6ebf5 --- /dev/null +++ b/queue-4.14/convert-trailing-spaces-and-periods-in-path-components.patch @@ -0,0 +1,43 @@ +From 57c176074057531b249cf522d90c22313fa74b0b Mon Sep 17 00:00:00 2001 +From: Boris Protopopov +Date: Thu, 24 Sep 2020 00:36:38 +0000 +Subject: Convert trailing spaces and periods in path components + +From: Boris Protopopov + +commit 57c176074057531b249cf522d90c22313fa74b0b upstream. + +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. + +Signed-off-by: Boris Protopopov +Acked-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/cifs_unicode.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/fs/cifs/cifs_unicode.c ++++ b/fs/cifs/cifs_unicode.c +@@ -501,7 +501,13 @@ cifsConvertToUTF16(__le16 *target, const + 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; diff --git a/queue-4.14/series b/queue-4.14/series index 4f812c9e59d..d0918c079ac 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -82,3 +82,4 @@ xen-events-block-rogue-events-for-some-time.patch perf-core-fix-race-in-the-perf_mmap_close-function.patch revert-kernel-reboot.c-convert-simple_strtoul-to-kstrtoint.patch reboot-fix-overflow-parsing-reboot-cpu-number.patch +convert-trailing-spaces-and-periods-in-path-components.patch