Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.2:Ports
hashalot
hashalot-ctrl-d.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File hashalot-ctrl-d.diff of Package hashalot
exit unsuccessfully on empty passphrase if input is a tty allows user to press ctrl-d to abort Signed-off-by: Ludwig Nussel <ludwig.nussel@suse.de> Index: hashalot-0.3/hashalot.c =================================================================== --- hashalot-0.3.orig/hashalot.c +++ hashalot-0.3/hashalot.c @@ -135,10 +135,14 @@ phash_lookup(const char phash_name[], si static char * xgetpass(const char *prompt) { - if (isatty(STDIN_FILENO)) /* terminal */ - return getpass(prompt); /* FIXME getpass(3) obsolete */ - else { /* file descriptor */ - char *pass = NULL; + char *pass = NULL; + if (isatty(STDIN_FILENO)) { /* terminal */ + pass = getpass(prompt); /* FIXME getpass(3) obsolete */ + if(!pass || !*pass) { + exit(EXIT_FAILURE); + } + return pass; + } else { /* file descriptor */ int buflen, i; buflen=0;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor