Bug 14379 - stat gets state confused using NT1
Summary: stat gets state confused using NT1
Status: RESOLVED DUPLICATE of bug 14101
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 4.12.2
Hardware: All All
: P5 regression (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-14 11:44 UTC by Harald Sitter
Modified: 2020-05-15 09:58 UTC (History)
1 user (show)

See Also:


Attachments
example (2.85 KB, application/x-xz)
2020-05-14 11:44 UTC, Harald Sitter
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2020-05-14 11:44:36 UTC
Created attachment 15979 [details]
example

With libsmbclient 4.12.2 a stat after/during a readdir(plus2) seems to regularly get confused and return a previously queried path rather than the current one. Only when the server and client are in NT1 mode though. Seems to work fine on smbclient 4.7.6, so I guess this regressed at some point.

We are seeing this downstream in KIO: https://bugs.kde.org/show_bug.cgi?id=421228

I'm attaching an example for this. It is a slightly modified testbrowse.c that displays the mode of the stat. The tar also includes a bare bones smb.conf as well as an example dir to reproduce this with.

Sample output running against smbd 4.12.2:

-- smbclient 4.12.2 (broken - S_ISDIR is true; size is 0)
url: smb://192.168.100.238/guest
Opening (smb://192.168.100.238/guest)...
Workgroup: [WORKGROUP] 
Username: [manjaro] 
Password: 
.                             DIR
..                            DIR
file                          FILE S_ISDIR 1 S_ISREG 0 mode 16877 size 0

-- smbclient 4.7.6 (working - S_ISDIR is false)
url: smb://192.168.100.238/guest
Opening (smb://192.168.100.238/guest)...
Workgroup: [WORKGROUP] 
Username: [me] 
Password: 
.                             DIR
..                            DIR
file                          FILE S_ISDIR 0 S_ISREG 1 mode 33188 size 4
Comment 1 Volker Lendecke 2020-05-14 16:27:02 UTC
Is it possible that this also depends on "unix extensions = yes"? Can you reproduce this behaviour also if you explicitly set "unix extensions = no"? If so, can you try patch

https://bugzilla.samba.org/attachment.cgi?id=15901

from https://bugzilla.samba.org/show_bug.cgi?id=14101?
Comment 2 Harald Sitter 2020-05-15 09:58:32 UTC
That indeed seems to be the same issue. Disabling the unix extension makes the client behave correctly and the patch fixes it even with extensions enabled.
Sorry for the noise.

*** This bug has been marked as a duplicate of bug 14101 ***