mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
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 <slow@samba.org> Reviewed-by: Noel Power <npower@samba.org> (backported from commit 8e997bd6e9250499fd8e569d708edc29e304a0e8) [slow@samba.org: conflicts in tests.py caused by unrelated tests]
This commit is contained in:
parent
5fd138ad80
commit
5598ddaaf4
1
selftest/knownfail.d/samba3.rpc.mdssvc
Normal file
1
selftest/knownfail.d/samba3.rpc.mdssvc
Normal file
@ -0,0 +1 @@
|
||||
^samba3.rpc.mdssvc.rpccmd.open_spotlight_disabled\(fileserver\)
|
@ -882,7 +882,7 @@ for t in tests:
|
||||
plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/tmp -U$USERNAME%$PASSWORD', 'over ncacn_np ')
|
||||
plansmbtorture4testsuite(t, "ad_dc", 'ncacn_ip_tcp:$SERVER_IP -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
|
||||
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 == "rpc.samr.passwords.validate":
|
||||
plansmbtorture4testsuite(t, "nt4_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
|
||||
plansmbtorture4testsuite(t, "ad_dc", 'ncacn_ip_tcp:$SERVER_IP[seal] -U$USERNAME%$PASSWORD', 'over ncacn_ip_tcp ')
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user