const char *domain = NULL;
enum credentials_obtained obtained = CRED_UNINITIALISED;
- username = cli_credentials_get_username_and_obtained(creds, &obtained);
- if (username != NULL) {
+ domain = cli_credentials_get_domain_and_obtained(creds, &obtained);
+ if (domain != NULL) {
bool overwrite = false;
- if (usr[0] == '\0') {
+ if (dom[0] == '\0') {
overwrite = true;
}
if (obtained >= CRED_CALLBACK_RESULT) {
overwrite = true;
}
if (overwrite) {
- strncpy(usr, username, usr_len - 1);
+ strncpy(dom, domain, dom_len - 1);
}
}
- password = cli_credentials_get_password_and_obtained(creds, &obtained);
- if (password != NULL) {
+ username = cli_credentials_get_username_and_obtained(creds, &obtained);
+ if (username != NULL) {
bool overwrite = false;
if (usr[0] == '\0') {
overwrite = true;
overwrite = true;
}
if (overwrite) {
- strncpy(pwd, password, pwd_len - 1);
+ strncpy(usr, username, usr_len - 1);
}
}
- domain = cli_credentials_get_domain_and_obtained(creds, &obtained);
- if (domain != NULL) {
+ password = cli_credentials_get_password_and_obtained(creds, &obtained);
+ if (password != NULL) {
bool overwrite = false;
- if (usr[0] == '\0') {
+ if (pwd[0] == '\0') {
overwrite = true;
}
if (obtained >= CRED_CALLBACK_RESULT) {
overwrite = true;
}
if (overwrite) {
- strncpy(dom, domain, dom_len - 1);
+ strncpy(pwd, password, pwd_len - 1);
}
}