diff options
| author | Andrew Bartlett <abartlet@samba.org> | 2008-03-19 10:18:35 +1100 |
|---|---|---|
| committer | Andrew Bartlett <abartlet@samba.org> | 2008-03-19 10:18:35 +1100 |
| commit | b1b37e3776c6e6e20f42140a907e296b65cc0c62 (patch) | |
| tree | 601f049791bcbd9df9daef64b0b1003dbf1a413b /source4/lib/replace/getpass.c | |
| parent | 9e6b0c28712ee77ce878809c8576826a3ba08d95 (diff) | |
| parent | 52669d84722c175555e17a222077f845d9aa958f (diff) | |
| download | samba-b1b37e3776c6e6e20f42140a907e296b65cc0c62.tar.gz samba-b1b37e3776c6e6e20f42140a907e296b65cc0c62.tar.bz2 samba-b1b37e3776c6e6e20f42140a907e296b65cc0c62.zip | |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit 400c16e7004bc3a881bb6efb99a273cdac87f70c)
Diffstat (limited to 'source4/lib/replace/getpass.c')
| -rw-r--r-- | source4/lib/replace/getpass.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/replace/getpass.c b/source4/lib/replace/getpass.c index d91d029f6a..73333b9021 100644 --- a/source4/lib/replace/getpass.c +++ b/source4/lib/replace/getpass.c @@ -185,7 +185,13 @@ char *rep_getpass(const char *prompt) buf[0] = 0; if (!gotintr) { in_fd = fileno(in); - fgets(buf, bufsize, in); + if (fgets(buf, bufsize, in) == NULL) { + buf[0] = 0; + if (in && in != stdin) { + fclose(in); + } + return buf; + } } nread = strlen(buf); if (nread) { |
