directory with a symlink pointing to non-existing file

Pavel Filipensky pfilipen at redhat.com
Mon Oct 25 16:50:08 UTC 2021


I was not aware of xatrr_tdb, thx for pointing that out. I do not care
about config with xattr_tdb, it was more or less a coincidence.

However, it does not work with "fileserver" environment for me. What
exactly is your regression test doing?

some grep for "fileserver" environment :

$ grep test1 st/fileserver/logs/log.smbd

  synthetic_pathref: stat [test1/l2] failed: No such file or directory
  streams_depot_stat called for [test1/l2]
  streams_depot_stat called for [test1]
  streams_depot_rmdir_internal: called for test1
  rmdir_acl_common: unlink of test1 failed Directory not empty
  rmdir_internals: couldn't remove directory test1 : Directory not empty
  close_directory: test1. Delete on close was set - deleting directory
returned NT_STATUS_DIRECTORY_NOT_EMPTY.
  smbd_smb2_close: close_file[test1]: NT_STATUS_DIRECTORY_NOT_EMPTY




On Mon, Oct 25, 2021 at 6:34 PM Jeremy Allison <jra at samba.org> wrote:

> On Mon, Oct 25, 2021 at 06:21:00PM +0200, Pavel Filipensky via
> samba-technical wrote:
> >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.
>
> That's probably expected when you have xattr_tdb loaded.
> That's an unusual configuration to be running with dangling
> symlinks and I don't expect any normal fileserver to be
> doing that.
>
> Don't do that (ie. don't run the regression test against
> ad_member_idmap_rid :-).
>
> I have a regression test that works against the "fileserver"
> environment. I'm planning on fixing this up and submitting
> to Ralph for review this week.
>
> Once it's in, if you really want to make it work against
> an AD-DC config with xattr_tdb loaded then we'll log a
> separate bug and deal with it there, but to be honest
> it's unlikely anyone would care.
>
> Jeremy.
>
>
>


More information about the samba-technical mailing list