1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-07 00:58:40 +03:00

tests: Show that streams_depot and shadow_copy2 don't play together

See the next patch, we assert in shadow_copy2_openat() over paths
passed in from shadow_copy2

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15358

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-04-14 15:34:17 +00:00 committed by Jeremy Allison
parent 081e808ab4
commit 0327334c89
3 changed files with 20 additions and 1 deletions

View File

@ -19,7 +19,7 @@
from samba.samba3 import libsmb_samba_internal as libsmb
from samba.dcerpc import security
from samba import NTSTATUSError
from samba import NTSTATUSError,ntstatus
from samba.ntstatus import NT_STATUS_DELETE_PENDING
from samba.credentials import SMB_ENCRYPTION_REQUIRED
import samba.tests.libsmb
@ -202,6 +202,19 @@ class LibsmbTestCase(samba.tests.libsmb.LibsmbTests):
c.rmdir("subdir")
self.assertTrue(ret)
def test_libsmb_shadow_depot(self):
c = libsmb.Conn(self.server_ip, "shadow_depot", self.lp, self.creds)
try:
fnum=c.create("x:y",CreateDisposition=libsmb.FILE_CREATE)
c.close(fnum)
except:
self.fail()
finally:
# "c" might have crashed, get a new connection
c1 = libsmb.Conn(self.server_ip, "shadow_depot", self.lp, self.creds)
c1.unlink("x")
c1 = None
if __name__ == "__main__":
import unittest
unittest.main()

View File

@ -0,0 +1 @@
^samba.tests.libsmb-basic.samba.tests.libsmb-basic.LibsmbTestCase.test_libsmb_shadow_depot\(fileserver_smb1\)

View File

@ -3408,6 +3408,11 @@ sub provision($$)
shadow:fixinodes = yes
smbd async dosmode = yes
[shadow_depot]
path = $shadow_shrdir
comment = previous versions with streams_depot
vfs objects = streams_depot shadow_copy2
[dfq]
path = $shrdir/dfree
vfs objects = acl_xattr fake_acls xattr_tdb fake_dfq