]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: Fix and improve cifs_is_path_accessible() function
authorPali Rohár <pali@kernel.org>
Mon, 6 Jul 2026 18:48:09 +0000 (20:48 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 9 Jul 2026 23:19:54 +0000 (18:19 -0500)
commit90dd1415a158b99ca16f5fe5862c07683e9ddcec
treea136855cfa1582d86f107c6ec8d1d2291558e104
parente3d9c7160d483fc8f9e225aafad8ecbbc43f3151
cifs: Fix and improve cifs_is_path_accessible() function

Do not call SMBQueryInformation() command for path with SMB wildcard
characters on non-UNICODE connection because server expands wildcards.
Function cifs_is_path_accessible() needs to check if the real path exists
and must not expand wildcard characters.

Do not dynamically allocate memory for small FILE_ALL_INFO structure and
instead allocate it on the stack. This structure is allocated on stack by
all other functions.

When CAP_NT_SMBS was not negotiated then do not issue CIFSSMBQPathInfo()
command. This command returns failure by non-NT Win9x SMB servers, so there
is no need try it. The purpose of cifs_is_path_accessible() function is
just to check if the path is accessible, so SMBQueryInformation() for old
servers is enough.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb1ops.c