git.samba.org
/
jra
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3f76504
)
Fix replacement getpass. If we ^C at the prompt echo was left off.
author
Jeremy Allison
<jra@samba.org>
Fri, 9 May 2008 21:51:45 +0000
(14:51 -0700)
committer
Jeremy Allison
<jra@samba.org>
Fri, 9 May 2008 21:51:45 +0000
(14:51 -0700)
Jeremy.
(This used to be commit
e54c71954ae484fe4a4e195db33440490e78e256
)
source3/lib/replace/getpass.c
patch
|
blob
|
history
diff --git
a/source3/lib/replace/getpass.c
b/source3/lib/replace/getpass.c
index 73333b902199b92d6627f2c1794124ebf7922ce8..0be618fc916cf21d6d7e6122d0ac847759ae6002 100644
(file)
--- a/
source3/lib/replace/getpass.c
+++ b/
source3/lib/replace/getpass.c
@@
-187,10
+187,6
@@
char *rep_getpass(const char *prompt)
in_fd = fileno(in);
if (fgets(buf, bufsize, in) == NULL) {
buf[0] = 0;
in_fd = fileno(in);
if (fgets(buf, bufsize, in) == NULL) {
buf[0] = 0;
- if (in && in != stdin) {
- fclose(in);
- }
- return buf;
}
}
nread = strlen(buf);
}
}
nread = strlen(buf);
@@
-201,8
+197,9
@@
char *rep_getpass(const char *prompt)
/* Restore echoing. */
if (echo_off) {
/* Restore echoing. */
if (echo_off) {
- if (gotintr && in_fd == -1)
+ if (gotintr && in_fd == -1)
{
in = fopen ("/dev/tty", "w+");
in = fopen ("/dev/tty", "w+");
+ }
if (in != NULL)
tcsetattr (fileno (in), TCSANOW, &t);
}
if (in != NULL)
tcsetattr (fileno (in), TCSANOW, &t);
}