s3:client: avoid cli_credentials_get_password() to check for a specified password
[samba.git] / source3 / client / client.c
index 65012f51260672ec0f0434689067814430d1954d..2052eb5ed4c595bcc2656a03b44ebc6c3409e13a 100644 (file)
@@ -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),