From: Stefan Metzmacher Date: Thu, 14 Apr 2022 11:30:56 +0000 (+0200) Subject: lib/cmdline: move cli_credentials_set_cmdline_callbacks to the end of POPT_CALLBACK_R... X-Git-Tag: tdb-1.4.11~1009 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=994e12e8f7a6b089342a32a6c3269048bfef1545;p=thirdparty%2Fsamba.git lib/cmdline: move cli_credentials_set_cmdline_callbacks to the end of POPT_CALLBACK_REASON_POST BUG: https://bugzilla.samba.org/show_bug.cgi?id=15018 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c index db962146bd2..4b03f023105 100644 --- a/lib/cmdline/cmdline.c +++ b/lib/cmdline/cmdline.c @@ -803,19 +803,6 @@ static void popt_common_credentials_callback(poptContext popt_ctx, "Unable to read defaults from smb.conf\n"); } - (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); - if (!ok) { - fprintf(stderr, - "Failed to set cmdline password " - "callback\n"); - exit(1); - } - } - if (machine_account_pending) { NTSTATUS status; @@ -850,6 +837,19 @@ 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 && + password_obtained < CRED_CALLBACK) { + ok = cli_credentials_set_cmdline_callbacks(creds); + if (!ok) { + fprintf(stderr, + "Failed to set cmdline password " + "callback\n"); + exit(1); + } + } + return; }