]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Fix net_context_creds() with machine password
authorAndreas Schneider <asn@samba.org>
Thu, 25 Mar 2021 11:03:22 +0000 (12:03 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 30 Mar 2021 05:48:37 +0000 (05:48 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/net_util.c

index 6c5321db0fd3f2d82b57acb2c369322d5c2576e7..7383d593f536684e7836c07bc22b9f7bd38e1787 100644 (file)
@@ -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) {