lib/cmdline: only call cli_credentials_get_password_and_obtained if needed
authorStefan Metzmacher <metze@samba.org>
Thu, 14 Apr 2022 11:31:20 +0000 (13:31 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 23 Apr 2024 14:17:32 +0000 (14:17 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15018

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
lib/cmdline/cmdline.c

index 4b03f0231054f752c96c5d442309779a5ed44ed4..6f081324e64c3758486fd779e838d0a66be6edc4 100644 (file)
@@ -837,8 +837,10 @@ static void popt_common_credentials_callback(poptContext popt_ctx,
                                                     CRED_SPECIFIED);
                }
 
-               (void)cli_credentials_get_password_and_obtained(creds,
-                                                               &password_obtained);
+               if (!skip_password_callback) {
+                       (void)cli_credentials_get_password_and_obtained(creds,
+                                                                       &password_obtained);
+               }
                if (!skip_password_callback &&
                    password_obtained < CRED_CALLBACK) {
                        ok = cli_credentials_set_cmdline_callbacks(creds);