From: Stefan Metzmacher Date: Thu, 14 Apr 2022 11:49:39 +0000 (+0200) Subject: s3:client: avoid cli_credentials_get_password() to check for a specified password X-Git-Tag: tdb-1.4.11~851 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1275e77933f74b5b8551aa9c5e5f84fbd561de04;p=thirdparty%2Fsamba.git s3:client: avoid cli_credentials_get_password() to check for a specified password Using cli_credentials_get_password_obtained() is more lightweight as it avoids a possible password prompt. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/source3/client/client.c b/source3/client/client.c index 65012f51260..2052eb5ed4c 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -6627,7 +6627,7 @@ int main(int argc,char *argv[]) /* if the service has already been retrieved then check if we have also a password */ if (service_opt && - cli_credentials_get_password(creds) == NULL && + cli_credentials_get_password_obtained(creds) != CRED_SPECIFIED && poptPeekArg(pc)) { cli_credentials_set_password(creds, poptGetArg(pc), @@ -6731,7 +6731,7 @@ int main(int argc,char *argv[]) /* if the service has already been retrieved then check if we have also a password */ if (service_opt && - cli_credentials_get_password(creds) == NULL && + cli_credentials_get_password_obtained(creds) != CRED_SPECIFIED && poptPeekArg(pc)) { cli_credentials_set_password(creds, poptGetArg(pc),