Bug 14879 - A directory containing dangling symlinks cannot be deleted by SMB2 alone when they are the only entry in the directory
Summary: A directory containing dangling symlinks cannot be deleted by SMB2 alone when...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.15.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on: 14878
Blocks: 14892
  Show dependency treegraph
 
Reported: 2021-10-21 18:55 UTC by Jeremy Allison
Modified: 2021-12-15 14:53 UTC (History)
4 users (show)

See Also:


Attachments
Raw patch that fixes this bug and also 4878 (4.34 KB, patch)
2021-10-21 18:58 UTC, Jeremy Allison
no flags Details
git-am fix for 4.15.next. (20.45 KB, patch)
2021-10-29 18:16 UTC, Jeremy Allison
slow: review+
Details
patch for v4-14 (28.95 KB, patch)
2021-11-24 11:56 UTC, Pavel Filipenský
jra: review+
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2021-10-21 18:55:51 UTC
Dangling symlinks are implicitly vetoed files in SMB2, they are not shown to the client. A directory containing a dangling symlink cannot be deleted by SMB2 even though the client cannot see the dangling symlink entry.

We need to allow directories containing only dangling symlinks to be deleted by a Windows client when "delete veto files = yes" is set.

Called out by Pavel Filipensky <pfilipen@redhat.com> on the samba-technical list.

Have a patch, need bugid and regression test.
Comment 1 Jeremy Allison 2021-10-21 18:58:04 UTC
Created attachment 16863 [details]
Raw patch that fixes this bug and also 4878

Storing it here so I don't lose it. This needs to be paired with regression tests.
Comment 2 Samba QA Contact 2021-10-29 15:31:36 UTC
This bug was referenced in samba master:

942123b95923f35a32df4196a072a3ed3468396a
295d7d026babe3cd5123d0f53adcb16868907f05
f254be19d6501a4f573843af97963e350a9ee2ed
a37d16e7c55f85e3f2c9c8614755ea6307092d5f
26fecad2e66e91a3913d88ee2e0889f266e91d89
e9ef970eee5eca8ab3720279c54098e91d2dfda9
0b818c6b77e972626d0b071bebcf4ce55619fb84
Comment 3 Jeremy Allison 2021-10-29 18:16:54 UTC
Created attachment 16900 [details]
git-am fix for 4.15.next.

Cherry-picked from master. Note this must be applied *after* the fix in:
https://bugzilla.samba.org/show_bug.cgi?id=14878
Comment 4 Ralph Böhme 2021-11-04 07:54:29 UTC
Reassigning to Jule for inclusion in 4.15.
Comment 5 Jeremy Allison 2021-11-04 21:18:07 UTC
Note to Jule:

Please note the patches for these bugs *MUST* be applied in the following
order:

https://bugzilla.samba.org/show_bug.cgi?id=14878
https://bugzilla.samba.org/show_bug.cgi?id=14879
https://bugzilla.samba.org/show_bug.cgi?id=14892

in order to apply correctly. Thanks !
Comment 6 Jule Anger 2021-11-10 14:26:55 UTC
Pushed to autobuild-v4-15-test.
Comment 7 Samba QA Contact 2021-11-10 17:08:24 UTC
This bug was referenced in samba v4-15-test:

359517877d6462ff4398401748f921c8b79357a6
7a4173809a87350bc3580240232978042ec2ceca
0dba0917fd97e975d1daab5b0828644d026c2bc5
e00fe095e8cf7ab54bc82870b913762d2fdddbad
4793c4d5307472f0eb72f70f7dbf7324744e3f91
5023dbc04bfad7cc39e8c4de96f40c82e7a0288e
a549dc219cba5bd61969e4919ae4142f52c133ea
Comment 8 Jule Anger 2021-11-10 18:03:46 UTC
Closing out bug report.

Thanks!
Comment 9 Pavel Filipenský 2021-11-24 11:56:12 UTC
Created attachment 17024 [details]
patch for v4-14

a549dc2 s3: docs-xml: Clarify the "delete veto files" paramter.
- as original

5023dbc s3: smbd: Fix logic in can_delete_directory_fsp() to cope with dangling symlinks.
- modified to match 4.14

4793c4d s3: smbd: Fix logic in rmdir_internals() to cope with dangling symlinks.
- modified to match 4.14

e00fe09 s3: smbd: Fix rmdir_internals() to do an early return if lp_delete_veto_files() is not set.
- modified to match 4.14

0dba091 s3: VFS: xattr_tdb. Allow unlinkat to cope with dangling symlinks.
- modified to match 4.14

7a41738 s3: VFS: streams_depot. Allow unlinkat to cope with dangling symlinks.
- modified to match 4.14

3595178 s3: smbd: Add two tests showing the ability to delete a directory containing a dangling symlink over SMB2 depends on "delete veto files" setting.
- as original
Comment 10 Ralph Böhme 2021-12-02 09:38:16 UTC
Jule, please also push the patch for 4.14. Thanks!
Comment 11 Jule Anger 2021-12-02 10:30:20 UTC
Pushed to autobuild-v4-14-test.
Comment 12 Samba QA Contact 2021-12-02 11:55:39 UTC
This bug was referenced in samba v4-14-test:

67c85f0ce8e2e8d5c4cc3a8752ac423aef3ef736
37804062ea7babdd7e304343fbc054d8946170dc
3d4761cf04ddf386e1565131351d28ca315b9626
66d688cea2bd4071128bbaa2afd810d89daab370
7034f9b765de5d9423c903761a3fe5549d7fe9a7
b61fb49a7a90a4b8fb2df6b9970db9bc5e16027d
aef700ad3c800dc33ccf4c470d45416c97fde210
Comment 13 Jule Anger 2021-12-02 15:37:18 UTC
Closing out bug report.

Thanks!
Comment 14 Samba QA Contact 2021-12-08 14:57:00 UTC
This bug was referenced in samba v4-15-stable (Release samba-4.15.3):

359517877d6462ff4398401748f921c8b79357a6
7a4173809a87350bc3580240232978042ec2ceca
0dba0917fd97e975d1daab5b0828644d026c2bc5
e00fe095e8cf7ab54bc82870b913762d2fdddbad
4793c4d5307472f0eb72f70f7dbf7324744e3f91
5023dbc04bfad7cc39e8c4de96f40c82e7a0288e
a549dc219cba5bd61969e4919ae4142f52c133ea
Comment 15 Samba QA Contact 2021-12-15 14:53:27 UTC
This bug was referenced in samba v4-14-stable (Release samba-4.14.11):

67c85f0ce8e2e8d5c4cc3a8752ac423aef3ef736
37804062ea7babdd7e304343fbc054d8946170dc
3d4761cf04ddf386e1565131351d28ca315b9626
66d688cea2bd4071128bbaa2afd810d89daab370
7034f9b765de5d9423c903761a3fe5549d7fe9a7
b61fb49a7a90a4b8fb2df6b9970db9bc5e16027d
aef700ad3c800dc33ccf4c470d45416c97fde210