Fixing to not drop the isatty check that was there.
This commit is contained in:
parent
74306c93cb
commit
241b8af9e8
@ -879,11 +879,15 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
|
|||||||
}
|
}
|
||||||
/* password */
|
/* password */
|
||||||
if (NULL == settings->password) {
|
if (NULL == settings->password) {
|
||||||
char input[512];
|
settings->password = xmalloc(512 * sizeof(char));
|
||||||
input[0] = '\0';
|
if (isatty(STDIN_FILENO))
|
||||||
printf("password: ");
|
freerdp_passphrase_read("password: ", settings->password, 512, settings->from_stdin);
|
||||||
if (scanf("%511s", input) > 0) {
|
else {
|
||||||
settings->password = xstrdup(input);
|
printf("password: ");
|
||||||
|
if (scanf("%511s", settings->password) <= 0) {
|
||||||
|
free(settings->password);
|
||||||
|
settings->password = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* domain */
|
/* domain */
|
||||||
|
Loading…
Reference in New Issue
Block a user