directory with a symlink pointing to non-existing file

Pavel Filipensky pfilipen at redhat.com
Mon Oct 25 16:21:00 UTC 2021


Hi Jeremy,

thanks for looking into this and providing the fix. I was trying to test
the fix attached to https://bugzilla.samba.org/show_bug.cgi?id=14879 but
still doesn't work.
I am using this env:

make -j8 testenv SELFTEST_TESTENV=ad_member_idmap_rid:local SCREEN=1
 SMBD_OPTIONS=-d100
mkdir st/ad_member_idmap_rid/share/test1
ln -s st/ad_member_idmap_rid/share/test1/l1
st/ad_member_idmap_rid/share/test1/l2

smb.conf has "delete veto files = yes"

then I run "rmdir test1" in

bin/smbclient //$SERVER/tmp -U$DC_USERNAME%$DC_PASSWORD


The point where it all  fails is here:

(gdb) bt 6
#0  xattr_tdb_unlinkat (handle=0x557646d5cd30, dirfsp=0x557646d69fc0,
smb_fname=0x557646d70a50, flags=0) at
../../source3/modules/vfs_xattr_tdb.c:524
#1  0x00007f84d2fd73ce in smb_vfs_call_unlinkat (handle=0x557646d5cd30,
dirfsp=0x557646d69fc0, smb_fname=0x557646d70a50, flags=0) at
../../source3/smbd/vfs.c:2218
#2  0x00007f84d31141ca in unlink_acl_common (handle=0x557646d54170,
dirfsp=0x557646d69fc0, smb_fname=0x557646d70a50, flags=0) at
../../source3/modules/vfs_acl_common.c:1146
#3  0x00007f84bdb0ed06 in acl_xattr_unlinkat (handle=0x557646d54170,
dirfsp=0x557646d69fc0, smb_fname=0x557646d70a50, flags=0) at
../../source3/modules/vfs_acl_xattr.c:265
#4  0x00007f84d2fd73ce in smb_vfs_call_unlinkat (handle=0x557646d54170,
dirfsp=0x557646d69fc0, smb_fname=0x557646d70a50, flags=0) at
../../source3/smbd/vfs.c:2218
#5  0x00007f84d2fcdb5a in rmdir_internals (ctx=0x557646c91760,
fsp=0x557646d628f0) at ../../source3/smbd/close.c:1285

On line 522 SMB_VFS_NEXT_STAT() returns -1 with errno 2:


  519 »·······if (full_fname->flags & SMB_FILENAME_POSIX_PATH) {

  520 »·······»·······ret = SMB_VFS_NEXT_LSTAT(handle, full_fname);

  521 »·······} else {

  522 »·······»·······ret = SMB_VFS_NEXT_STAT(handle, full_fname);

                                            523 »·······}

  524 »·······if (ret == -1) {

  525 »·······»·······goto out;

  526 »·······}

==============

If it helps I can prepare some regression test.

Pavel



On Thu, Oct 21, 2021 at 8:41 PM Jeremy Allison <jra at samba.org> wrote:

> On Thu, Oct 21, 2021 at 11:31:44AM -0700, Jeremy Allison via
> samba-technical wrote:
> >
> >Done lots more investigation on this, and it looks like
> >recursive directory deletion with veto files is broken in 4.15.0.
> >
> >I'll log a bug and fix..
>
> The second bug here is that when "delete veto files" is
> set that you can't delete a directory with dangling symlinks
> as a dangling symlink is an implicit vetoed file (it's
> never shown to Windows clients).
>
> That's a second bug, which I also have a fix for, but
> I need a regression test first.
>
>


More information about the samba-technical mailing list