From: Andreas Schneider Date: Thu, 25 Mar 2021 11:03:22 +0000 (+0100) Subject: s3:utils: Fix net_context_creds() with machine password X-Git-Tag: tevent-0.11.0~1351 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c8e477edc0fc05c97c0ed9e26103fed278ee2890;p=thirdparty%2Fsamba.git s3:utils: Fix net_context_creds() with machine password Signed-off-by: Andreas Schneider Reviewed-by: Ralph Boehme --- diff --git a/source3/utils/net_util.c b/source3/utils/net_util.c index 6c5321db0fd..7383d593f53 100644 --- a/source3/utils/net_util.c +++ b/source3/utils/net_util.c @@ -475,7 +475,13 @@ struct cli_credentials *net_context_creds(struct net_context *c, struct cli_credentials *creds = NULL; struct loadparm_context *lp_ctx = NULL; - c->opt_password = net_prompt_pass(c, c->opt_user_name); + /* + * Do not query the password if we defined we want to use the + * machine account. + */ + if (c->opt_machine_pass) { + c->opt_password = net_prompt_pass(c, c->opt_user_name); + } creds = cli_credentials_init(mem_ctx); if (creds == NULL) {