Bug 14257 - The base.delete.deltest20 fails when running as root
Summary: The base.delete.deltest20 fails when running as root
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services (show other bugs)
Version: 4.11.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-30 09:30 UTC by Andreas Schneider
Modified: 2020-02-04 09:59 UTC (History)
2 users (show)

See Also:


Attachments
log files + strace (root + user) (415.05 KB, application/x-xz)
2020-01-30 09:30 UTC, Andreas Schneider
no flags Details
patch for 4.12 and 4.11 (1.19 KB, patch)
2020-01-31 09:28 UTC, Andreas Schneider
slow: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Schneider 2020-01-30 09:30:47 UTC
Created attachment 15756 [details]
log files + strace (root + user)

The base.delete.deltest20 fails when running as root, it works as a normal user:

$ make -j20 test TESTS="base.delete.*nt4"
[..]
[1(0)/1 at 0s] samba3.base.delete(nt4_dc)
UNEXPECTED(failure): samba3.base.delete.deltest20(nt4_dc)
REASON: Exception: Exception: ../../source4/torture/basic/delete.c:1896: Expression `fnum1 == -1' failed: smbcli_open succeeded, should have failed with NT_STATUS_DELETE_PENDING
teardown_env(nt4_dc)


Steps to manually reproduce:
. seltest/devel_env.sh
make -j20 testenv SELFTEST_TESTENV=nt4_dc SMBD_OPTIONS=-d10

In the xterm:
./bin/smbtorture  $LOADLIST --configfile=$SMB_CONF_PATH --option='fss:sequence timeout=1' --maximum-runtime=$SELFTEST_MAXTIME --basedir=$SELFTEST_TMPDIR --format=subunit --option=torture:progress=no --option=torture:sharedelay=100000 --option=torture:writetimeupdatedelay=500000 --target=samba3 //$SERVER_IP/tmp -U$USERNAME%$PASSWORD base.delete.deltest20
Comment 1 Ralph Böhme 2020-01-30 15:08:49 UTC
It's a feature.

In check_parent_access() we check whether we're running as root and if we are, we skip the check for delete-on-close-set.
Comment 2 Andreas Schneider 2020-01-30 15:14:14 UTC
Ralph, but then I think we need to check for root in the test and skip it ...
Comment 3 Andreas Schneider 2020-01-30 15:20:46 UTC
See https://gitlab.com/samba-team/samba/-/merge_requests/1102
Comment 4 Ralph Böhme 2020-01-30 15:24:17 UTC
(In reply to Andreas Schneider from comment #2)
Yeah, good point. There are probably a bunch of other tests that will stumble across the same issue.
Comment 5 Andreas Schneider 2020-01-31 09:28:09 UTC
Created attachment 15759 [details]
patch for 4.12 and 4.11
Comment 6 Ralph Böhme 2020-01-31 09:29:52 UTC
What about 4.10?
Comment 7 Andreas Schneider 2020-01-31 10:36:41 UTC
Karolin, could you please apply the patch to 4.12, 4.11 and 4.10. The patch should apply without any problem on all those branches. Thanks!
Comment 8 Karolin Seeger 2020-01-31 10:48:03 UTC
Pushed to autobuild-v4-{12,11,10}-test.
Comment 9 Karolin Seeger 2020-02-04 09:59:48 UTC
(In reply to Karolin Seeger from comment #8)
Pushed to all branches.
Closing out bug report.

Thanks!