Bug 15791 - Remove of file or directory not possible with vfs_acl_tdb
Summary: Remove of file or directory not possible with vfs_acl_tdb
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.17.12
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-28 12:33 UTC by armin
Modified: 2025-01-29 10:33 UTC (History)
0 users

See Also:


Attachments
patch (1.05 KB, patch)
2025-01-28 13:56 UTC, Volker Lendecke
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description armin 2025-01-28 12:33:58 UTC
Tested with Samba 4.17.12 (but same code in 4.21).

When using "vfs objects = acl_tdb" it is not possible to remove files or 
 irectories in share.
The log always shows "rmdir_internals: couldn't remove .... : No such file or directory"
 
The cause is in file
  source3/modules/vfs_acl_tdb.c
in function
  unlinkat_acl_tdb()
 
The call "vfs_stat(handle->conn, smb_fname_tmp);" does a stat with the filename only, without the full path.
It always fails!
Removing this stat call and let the rest of the code do its job, all works.
Comment 1 Volker Lendecke 2025-01-28 13:56:32 UTC
Created attachment 18540 [details]
patch

Do you have the chance to test the attached patch?
Comment 2 armin 2025-01-29 10:33:02 UTC
The patch does not work.

The call to full_path_from_dirfsp_atname() creates just the relative path for the share. But vfs_stat() obviously needs the full path.

I just removed the call to vfs_stat() and removal is possible then.

But I found another problem.
Removing a directory works fine then, but removing a file causes an error.
The file is removed, but a "no such file or directory" is returned anyway.
And samba crashes with panic.
In the log it shows:
dbwrap_lock_order_lock: Lock order violation: Trying /var/lib/samba/file_ntacls.tdb at 1 while /run/samba/locking.tdb at 1 is locked