]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Nov 2020 12:19:58 +0000 (13:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Nov 2020 12:19:58 +0000 (13:19 +0100)
added patches:
convert-trailing-spaces-and-periods-in-path-components.patch

queue-5.9/convert-trailing-spaces-and-periods-in-path-components.patch [new file with mode: 0644]
queue-5.9/series

diff --git a/queue-5.9/convert-trailing-spaces-and-periods-in-path-components.patch b/queue-5.9/convert-trailing-spaces-and-periods-in-path-components.patch
new file mode 100644 (file)
index 0000000..3752dd0
--- /dev/null
@@ -0,0 +1,43 @@
+From 57c176074057531b249cf522d90c22313fa74b0b Mon Sep 17 00:00:00 2001
+From: Boris Protopopov <pboris@amazon.com>
+Date: Thu, 24 Sep 2020 00:36:38 +0000
+Subject: Convert trailing spaces and periods in path components
+
+From: Boris Protopopov <pboris@amazon.com>
+
+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 <pboris@amazon.com>
+Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
+@@ -488,7 +488,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;
index c84ccdef7a5838ac3062f452773708a80bea787d..51e80a652777f66ae928a0c284960d9936325a2d 100644 (file)
@@ -252,3 +252,4 @@ null_blk-fix-scheduling-in-atomic-with-zoned-mode.patch
 perf-scripting-python-avoid-declaring-function-pointers-with-a-visibility-attribute.patch
 coresight-etm-perf-sink-selection-using-sysfs-is-deprecated.patch
 coresight-fix-uninitialised-pointer-bug-in-etm_setup_aux.patch
+convert-trailing-spaces-and-periods-in-path-components.patch