From 0ba9e5dacbb4e5bf94600e0a4a1cbd9f7a9c5d9e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 14 Apr 2022 13:31:20 +0200 Subject: [PATCH] lib/cmdline: only call cli_credentials_get_password_and_obtained if needed BUG: https://bugzilla.samba.org/show_bug.cgi?id=15018 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- lib/cmdline/cmdline.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cmdline/cmdline.c b/lib/cmdline/cmdline.c index 4b03f023105..6f081324e64 100644 --- a/lib/cmdline/cmdline.c +++ b/lib/cmdline/cmdline.c @@ -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);