From: Ralph Boehme Date: Tue, 7 Jun 2022 07:52:53 +0000 (+0200) Subject: CI: fix check for correct mdsvc resonse when connecting to a share with Spotlight... X-Git-Tag: tevent-0.13.0~175 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e997bd6e9250499fd8e569d708edc29e304a0e8;p=thirdparty%2Fsamba.git CI: fix check for correct mdsvc resonse when connecting to a share with Spotlight disabled A Mac SMB server returns an all zero handle and an empty path if Spotlight is disabled on a share. We must return the exact same error return in order to trigger client-side searching. Bug: https://bugzilla.samba.org/show_bug.cgi?id=15086 pcap: https://www.samba.org/~slow/pcaps/mac-bigsur-smbserver-spotlight-disabled.pcapng.gz Signed-off-by: Ralph Boehme Reviewed-by: Noel Power --- diff --git a/selftest/knownfail.d/samba3.rpc.mdssvc b/selftest/knownfail.d/samba3.rpc.mdssvc new file mode 100644 index 00000000000..7a6ed0fe346 --- /dev/null +++ b/selftest/knownfail.d/samba3.rpc.mdssvc @@ -0,0 +1 @@ +^samba3.rpc.mdssvc.rpccmd.open_spotlight_disabled\(fileserver\) diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index dc3cd4f71a3..5acf89b0be4 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -895,7 +895,7 @@ for t in tests: # (there is rpc.lsa.secrets fails due to OpenPolicy2 for example) plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD') elif t == "rpc.mdssvc": - plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD --option=torture:no_spotlight_localdir=$SELFTEST_PREFIX/fileserver/share') + plansmbtorture4testsuite(t, "fileserver", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD') elif t == "smb2.durable-open" or t == "smb2.durable-v2-open" or t == "smb2.replay" or t == "smb2.durable-v2-delay": plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD') plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/durable -U$USERNAME%$PASSWORD') diff --git a/source4/torture/rpc/mdssvc.c b/source4/torture/rpc/mdssvc.c index 17e895a8cc2..8f16af66476 100644 --- a/source4/torture/rpc/mdssvc.c +++ b/source4/torture/rpc/mdssvc.c @@ -264,7 +264,7 @@ static bool test_mdssvc_open_spotlight_disabled(struct torture_context *tctx, data, struct torture_mdsscv_state); struct dcerpc_binding_handle *b = state->p->binding_handle; struct policy_handle ph; - const char *localdir = NULL; + struct policy_handle nullh; uint32_t device_id; uint32_t unkn2; uint32_t unkn3; @@ -282,17 +282,12 @@ static bool test_mdssvc_open_spotlight_disabled(struct torture_context *tctx, share_mount_path = torture_setting_string( tctx, "share_mount_path", "/foo/bar"); - localdir = torture_setting_string( - tctx, "no_spotlight_localdir", NULL); - torture_assert_not_null_goto( - tctx, localdir, ok, done, - "need 'no_spotlight_localdir' torture option \n"); - device_id_out = device_id = generate_random(); unkn2_out = unkn2 = 23; unkn3_out = unkn3 = 0; ZERO_STRUCT(ph); + ZERO_STRUCT(nullh); status = dcerpc_mdssvc_open(b, tctx, @@ -315,8 +310,12 @@ static bool test_mdssvc_open_spotlight_disabled(struct torture_context *tctx, torture_assert_u32_equal_goto(tctx, unkn3, unkn3_out, ok, done, "Bad unkn3\n"); - torture_assert_str_equal_goto(tctx, share_path, localdir, ok, done, - "Wrong share path\n"); + torture_assert_goto(tctx, share_path[0] == '\0', ok, done, + "Expected empty string as share path\n"); + + torture_assert_mem_equal_goto(tctx, &ph, &nullh, + sizeof(ph), ok, done, + "Expected all-zero policy handle\n"); done: return ok;