tests: Show that streams_depot and shadow_copy2 don't play together
authorVolker Lendecke <vl@samba.org>
Fri, 14 Apr 2023 15:34:17 +0000 (15:34 +0000)
committerJule Anger <janger@samba.org>
Tue, 18 Apr 2023 18:09:13 +0000 (18:09 +0000)
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>
(cherry picked from commit 0327334c89cfda9020c6044a7b2b182138e46d03)

python/samba/tests/libsmb-basic.py
selftest/knownfail.d/shadow_depot [new file with mode: 0644]
selftest/target/Samba3.pm

index 37b82b26dac647ac8559ca6b9a2667eef2543361..cbe7cce5bae356d0d311ea6a1f9b1ce09a600e34 100644 (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()
diff --git a/selftest/knownfail.d/shadow_depot b/selftest/knownfail.d/shadow_depot
new file mode 100644 (file)
index 0000000..0dbf553
--- /dev/null
@@ -0,0 +1 @@
+^samba.tests.libsmb-basic.samba.tests.libsmb-basic.LibsmbTestCase.test_libsmb_shadow_depot\(fileserver_smb1\)
index c8fe925a948ad337150387dd02aa88db5856389c..e0e3c026fa6d2324d015a0ab2c394da64c6e393b 100755 (executable)
@@ -3405,6 +3405,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