cURL cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1476 getpass_r() in tool_getpass.c is reading password from stdout instead of stdin

From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Tue, 03 Feb 2015 06:58:45 +0000

nice catch, thanks. Fixed that now!

---
** [bugs:#1476] getpass_r() in tool_getpass.c is reading password from stdout instead of stdin**
**Status:** closed-fixed
**Created:** Mon Jan 26, 2015 11:34 AM UTC by Tamir
**Last Updated:** Tue Feb 03, 2015 06:39 AM UTC
**Owner:** Daniel Stenberg
getpass_r() in tool_getpass.c is reading password from stdout instead of stdin
fd should be set 0 when /dev/tty is unavailable.
char *getpass_r(const char *prompt, /* prompt to display */
                char *password,     /* buffer to store password in */
                size_t buflen)      /* size of buffer to store password in */
{
...
  int fd = open("/dev/tty", O_RDONLY);
  if(-1 == fd)
    fd = 1; /* use stdin if the tty couldn't be used */
...
}
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2015-02-03

These mail archives are generated by hypermail.