s3: smbd: Fix cosmetic bug logging pathnames from Linux kernel clients using SMB1...
authorJeremy Allison <jra@samba.org>
Sat, 6 Aug 2022 02:27:33 +0000 (19:27 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 12 Aug 2022 18:19:30 +0000 (18:19 +0000)
commit2818fd6910201fd4a18b921933a0b7392a0a8995
treee39719746e5dfeec10c6ff781f55271334216a08
parent23988f19e7cc2823d6c0c0f40af0195d0a3b81bf
s3: smbd: Fix cosmetic bug logging pathnames from Linux kernel clients using SMB1 DFS calls.

The Linux kernel SMB1 client has a bug - it sends
DFS pathnames as:

\\server\share\path

instead of:

\server\share\path

Causing us to mis-parse server,share,remaining_path here
and jump into 'goto local_path' at 'share\path' instead
of 'path'.

This doesn't cause an error as the limits on share names
are similar to those on pathnames.

parse_dfs_path() which we call before filename parsing
copes with this by calling trim_char on the leading '\'
characters before processing.

Do the same here so logging of pathnames looks better.

How did I find this ? Lots and lots of manual
testing with the Linux kernel client to make
sure all the recent changes haven't broken Linux
SMB1/2/3 DFS :-).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15144

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb2_reply.c