diff options
author | Darren Tucker <dtucker@zip.com.au> | 2007-05-20 15:26:07 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2007-05-20 15:26:07 +1000 |
commit | 2216471510b3de30cb9df3e81bdfa267152ecd39 (patch) | |
tree | 09042cbcd2aef313b70ba8f8861c106bc680feaa /auth-pam.c | |
parent | 29171e9f5c094d912bd27c60b2973617e05cc785 (diff) | |
download | openssh-git-2216471510b3de30cb9df3e81bdfa267152ecd39.tar.gz |
- (dtucker) [auth-pam.c] Return empty string if fgets fails in
sshpam_tty_conv. Patch from ldv at altlinux.org.
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -984,7 +984,8 @@ sshpam_tty_conv(int n, sshpam_const struct pam_message **msg, break; case PAM_PROMPT_ECHO_ON: fprintf(stderr, "%s\n", PAM_MSG_MEMBER(msg, i, msg)); - fgets(input, sizeof input, stdin); + if (fgets(input, sizeof input, stdin) == NULL) + input[0] = '\0'; if ((reply[i].resp = strdup(input)) == NULL) goto fail; reply[i].resp_retcode = PAM_SUCCESS; |