1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:net_ads: require kerberos if we use ads_krb5_set_password() in ads_user_add()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-03-11 17:45:43 +01:00
parent 1eeeb76e6c
commit 5f32f14ef5

View File

@ -977,6 +977,20 @@ static int ads_user_add(struct net_context *c, int argc, const char **argv)
return net_ads_user_usage(c, argc, argv);
}
if (argc > 1) {
/*
* We rely on ads_krb5_set_password() to
* set the password below.
*
* We could pass the password to
* ads_add_user_acct()
* and set the unicodePwd attribute there...
*/
cli_credentials_set_kerberos_state(c->creds,
CRED_USE_KERBEROS_REQUIRED,
CRED_SPECIFIED);
}
status = ads_startup(c, false, tmp_ctx, &ads);
if (!ADS_ERR_OK(status)) {
goto done;