[PATCH v2] smb3: allow files to be created with backslash in name
Steve French
smfrench at gmail.com
Fri Dec 15 19:06:45 UTC 2023
I noticed that this patch got missed. Do you remember if any problems with it?
(I noticed it while deleting some old branches).
To avoid this happening in the future, I have created a
"for-next-next" in cifs-2.6.git for-next (similar to what we do with
ksmbd and have a "ksmbd-for-next" and a "ksmbd-for-next-next"). I
will add this patch to the for-next-next unless anyone has any
objections (pending more testing and review)
Since we basically have two types of patches - those that are for the
next RC (in this case rc6) vs. those that are for the next release (ie
6.8 merge window), I want to make sure we don't lose any of the latter
anymore.
On Sat, Feb 27, 2021 at 2:12 AM Steve French <smfrench at gmail.com> wrote:
>
> Backslash is reserved in Windows (and SMB2/SMB3 by default) but
> allowed in POSIX so must be remapped when POSIX extensions are
> not enabled.
>
> The default mapping for SMB3 mounts ("SFM") allows mapping backslash
> (ie 0x5C in UTF8) to 0xF026 in UCS-2 (using the Unicode remapping
> range reserved for these characters), but this was not mapped by
> cifs.ko (unlike asterisk, greater than, question mark etc). This patch
> fixes that to allow creating files and directories with backslash
> in the file or directory name.
>
> Before this patch:
> touch "/mnt2/subdir/filewith\slash"
> would return
> touch: setting times of '/mnt2/subdir/filewith\slash': Invalid argument
>
> With the patch tReported-by: Xiaoli Feng <xifeng at redhat.com>ouch and
> mkdir with the backslash in the name works.
>
> Version two of the patch works with files in subdirectories not just
> the root of the share.
>
> This problem was found while debugging xfstest generic/453
> https://bugzilla.kernel.org/show_bug.cgi?id=210961
>
> Reported-by: Xiaoli Feng <xifeng at redhat.com>
>
> --
> Thanks,
>
> Steve
--
Thanks,
Steve
More information about the samba-technical
mailing list