Replace obsolete getpass()
commit5e35e3953dbf13fba840e86dc790291f491c0a50
authorAntonio Borneo <Antonio Borneo@315857ad-0bdb-0310-b42e-dec37551a5f0>
Tue, 18 Feb 2014 05:09:39 +0000 (18 05:09 +0000)
committerAntonio Borneo <Antonio Borneo@315857ad-0bdb-0310-b42e-dec37551a5f0>
Tue, 18 Feb 2014 05:09:39 +0000 (18 05:09 +0000)
tree96e3ca6e240a3988f4263ec144c4093a2e2d0b25
parent935e58cb84aa52eaf4525c2b3424446f4cf0c2e2
Replace obsolete getpass()

Function getpass(3) is reported as obsolete.
Replace it with new vpnc_getpass().
Differences with original implementation:
- output prompt on stdout, instead of /dev/tty;
- input from stdin, instead of /dev/tty;
- password length limited by vpnc_getline() to 200 chars.

Functions tcgetattr()/tcsetattr() return error if stdin
is not a terminal but, e.g., a pipe or a file. I simply
ignore the error, since no need to disable ECHO on them.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
git-svn-id: https://svn.unix-ag.uni-kl.de/vpnc/trunk@542 315857ad-0bdb-0310-b42e-dec37551a5f0
config.c
config.h
sysdep.h
vpnc.c