Using cli_credentials_get_password_obtained() is more lightweight as
it avoids a possible password prompt.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
/* 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),
/* 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),