1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00

s3:utils: let 'net ads testjoin' fail without valid machine credentials

This will allow doing tests and make sure using anonymous credentials
doesn't cause false positive results...

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit ab3fc1595c)
This commit is contained in:
Stefan Metzmacher 2024-09-18 23:48:00 +02:00 committed by Jule Anger
parent 52772aed8b
commit d583d40ca3
2 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,4 @@
^samba3.blackbox.update_keytab_clustered.net_ads_testjoin_initial.clusteredmember
^samba3.blackbox.update_keytab_clustered.net_ads_testjoin_after_sync.clusteredmember
^samba3.blackbox.update_keytab_clustered.wbinfo_change_secret_after_sync.clusteredmember
^samba3.blackbox.update_keytab_clustered.net_ads_testjoin_final.clusteredmember

View File

@ -1556,6 +1556,12 @@ static ADS_STATUS net_ads_join_ok(struct net_context *c)
net_use_krb_machine_account(c);
if (!cli_credentials_authentication_requested(c->creds)) {
DBG_ERR("Failed to get machine credentials\n");
TALLOC_FREE(tmp_ctx);
return ADS_ERROR_NT(NT_STATUS_ACCESS_DENIED);
}
get_dc_name(lp_workgroup(), lp_realm(), dc_name, &dcip);
status = ads_startup(c, true, tmp_ctx, &ads);