]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/cifs/cifssmb.c
cifs: fix buffer format byte on NT Rename/hardlink
[karo-tx-linux.git] / fs / cifs / cifssmb.c
index 6d51696dc762d3b6656ed027fe2d7ed40d549409..0979c6fcbb2ffa66e8171012335726d77234b26f 100644 (file)
@@ -2350,8 +2350,10 @@ winCreateHardLinkRetry:
                                     PATH_MAX, nls_codepage, remap);
                name_len++;     /* trailing null */
                name_len *= 2;
-               pSMB->OldFileName[name_len] = 0;        /* pad */
-               pSMB->OldFileName[name_len + 1] = 0x04;
+
+               /* protocol specifies ASCII buffer format (0x04) for unicode */
+               pSMB->OldFileName[name_len] = 0x04;
+               pSMB->OldFileName[name_len + 1] = 0x00; /* pad */
                name_len2 =
                    cifsConvertToUCS((__le16 *)&pSMB->OldFileName[name_len + 2],
                                     toName, PATH_MAX, nls_codepage, remap);