diff options
author | Philipp Kerling <pkerling@casix.org> | 2025-06-29 20:05:05 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2025-06-30 00:16:29 +0300 |
commit | b8f89cb723b9e66f5dbd7199e4036fee34fb0de0 (patch) | |
tree | a7bb24137e76c90f065c06fcc04eae58ed7c5d5f /scripts/lib/kdoc/kdoc_parser.py | |
parent | d0b3b7b22dfa1f4b515fd3a295b3fd958f9e81af (diff) | |
download | linux-b8f89cb723b9e66f5dbd7199e4036fee34fb0de0.tar.xz |
smb: client: fix readdir returning wrong type with POSIX extensions
When SMB 3.1.1 POSIX Extensions are negotiated, userspace applications
using readdir() or getdents() calls without stat() on each individual file
(such as a simple "ls" or "find") would misidentify file types and exhibit
strange behavior such as not descending into directories. The reason for
this behavior is an oversight in the cifs_posix_to_fattr conversion
function. Instead of extracting the entry type for cf_dtype from the
properly converted cf_mode field, it tries to extract the type from the
PDU. While the wire representation of the entry mode is similar in
structure to POSIX stat(), the assignments of the entry types are
different. Applying the S_DT macro to cf_mode instead yields the correct
result. This is also what the equivalent function
smb311_posix_info_to_fattr in inode.c already does for stat() etc.; which
is why "ls -l" would give the correct file type but "ls" would not (as
identified by the colors).
Cc: stable@vger.kernel.org
Signed-off-by: Philipp Kerling <pkerling@casix.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_parser.py')
0 files changed, 0 insertions, 0 deletions