mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
Fix replacement getpass. If we ^C at the prompt echo was left off.
Jeremy. (This used to be commit e54c71954ae484fe4a4e195db33440490e78e256)
This commit is contained in:
parent
3f76504d92
commit
48b8bacfe4
@ -187,10 +187,6 @@ char *rep_getpass(const char *prompt)
|
||||
in_fd = fileno(in);
|
||||
if (fgets(buf, bufsize, in) == NULL) {
|
||||
buf[0] = 0;
|
||||
if (in && in != stdin) {
|
||||
fclose(in);
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
nread = strlen(buf);
|
||||
@ -201,8 +197,9 @@ char *rep_getpass(const char *prompt)
|
||||
|
||||
/* Restore echoing. */
|
||||
if (echo_off) {
|
||||
if (gotintr && in_fd == -1)
|
||||
if (gotintr && in_fd == -1) {
|
||||
in = fopen ("/dev/tty", "w+");
|
||||
}
|
||||
if (in != NULL)
|
||||
tcsetattr (fileno (in), TCSANOW, &t);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user