I'm trying to move a file (using Windows Explorer or via the command prompt): Photos\Untitled.png -> Photos\Work\Untitled.png This works when using samba 4.21, but fails with samba 4.22. Hence, this seems to be a regression in 4.22. The reason seems to be that folder "Photos" is a symlink (wide link). Moving files within that folder doesn't work anymore. Interestingly, reading and copying files within that folder works without any issue. Also, moving files in other locations (folder) where no symlinks (wide links) are used works fine. I've created a client specific level 10 log file using this guide: https://wiki.samba.org/index.php/Client_specific_logging The log files and my samba configuration can be downloaded here: https://www.van-roermund.nl/temp/samba-link-issue.zip
Going through the other bugs once again, I *think* this may actually be a duplicate of #15828: https://bugzilla.samba.org/show_bug.cgi?id=15828
I think vfs_widelinks needs to have an implementation of fstatat() added that removes the AT_SYMLINK_NOFOLLOW flag. That's the same approach it uses to turn lstat() into stat() to avoid symlinks being seen. My guess is that will fix this.
(In reply to Jeremy Allison from comment #2) I think that that is what you proposed here? https://bugzilla.samba.org/show_bug.cgi?id=15828#c2 If so: I've tested this patch, but it is not fixing the issue I have. In fact, the log shows the exact same behavior as before.
Ah well. So goes my quick fix idea :-). I'll need to try and reproduce first then to track down the exact regression.
Created attachment 18624 [details] preliminary patch Thanks to an idea by Ralph this fixes my reproducer
Do we also need the fstatat fix ?
(In reply to Volker Lendecke from comment #5) Thanks! I've just tried it and it seems to resolve the issue for me. I can now again move and delete files in a "wide link" location. I will keep using this patched version for a bit to see if everything works as expected.
(In reply to Jeremy Allison from comment #6) In the version I'm using now, I only applied the patch provided by Volker above. I did not apply the patch you provided yesterday (https://bugzilla.samba.org/show_bug.cgi?id=15828#c2).
FYI -- it seems that O_PATH may not always be available (defined). The maintainer for the samba package in Debian has uploaded a new version including this patch; and I just noticed that the build fails on some platforms: https://buildd.debian.org/status/package.php?p=samba&suite=sid The raw build log for the hurd-amd64 architecture: https://buildd.debian.org/status/fetch.php?pkg=samba&arch=hurd-amd64&ver=2%3A4.22.0%2Bdfsg-3&stamp=1743600500&raw=0 Relevant lines from this log: ../../source3/modules/vfs_widelinks.c: In function ‘widelinks_openat’: ../../source3/modules/vfs_widelinks.c:362:57: error: ‘O_PATH’ undeclared (first use in this function) 362 | how.flags = (how.flags & ~(O_NOFOLLOW | O_PATH)); | ^~~~~~ Cheers, Timo
https://gitlab.com/samba-team/samba/-/merge_requests/4018
This bug was referenced in samba master: 9e637a28bd0b5adc2d90df9ca4a1c864a648b0f4
Created attachment 18633 [details] Patch from master
Pushed to autobuild-v4-{22,21}-test.
This bug was referenced in samba v4-21-test: 1da707f1093abdcd0ee63c976a03fa4fff1f6423
This bug was referenced in samba v4-22-test: dadfa06573f3958f88b235c4d2e5ecedab78f6c5
This bug was referenced in samba v4-22-stable (Release samba-4.22.1): dadfa06573f3958f88b235c4d2e5ecedab78f6c5
Closing out bug report. Thanks!
This bug was referenced in samba v4-21-stable (Release samba-4.21.6): 1da707f1093abdcd0ee63c976a03fa4fff1f6423