[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] Use of getpass

We recently added a call to getpass(3) function. Needless to say this doesn't exist on Windows. More seriously the man-page for getpass on Linux has strong exhortations not to use the function.

       getpass - get a password

       #include <unistd.h>

       char *getpass( const char * prompt );

       This function is obsolete.  Do not use it.

The getpass() function opens /dev/tty (the controlling terminal of the process), outputs the string prompt, turns off echoing, reads one line (the "password"), restores the terminal state and closes /dev/tty
       Present in SUSv2, but marked LEGACY.  Removed in POSIX.1-2001.

Should we remove it?  Replace it?


Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]