diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-11-18 16:56:25 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-11-18 16:56:25 +0100 |
commit | 3fbb1dbd6ca47d047fb74d258269dabca285b7fb (patch) | |
tree | 0acb23724922cc2c26537081aa54dec288c8988f | |
parent | m (diff) | |
download | libpassphrase-3fbb1dbd6ca47d047fb74d258269dabca285b7fb.tar.gz libpassphrase-3fbb1dbd6ca47d047fb74d258269dabca285b7fb.tar.bz2 libpassphrase-3fbb1dbd6ca47d047fb74d258269dabca285b7fb.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/cerberus.c | 13 | ||||
-rw-r--r-- | src/cerberus.h | 7 | ||||
-rw-r--r-- | src/quit.h | 7 |
3 files changed, 18 insertions, 9 deletions
diff --git a/src/cerberus.c b/src/cerberus.c index 538b5f9..d84ea50 100644 --- a/src/cerberus.c +++ b/src/cerberus.c @@ -19,13 +19,6 @@ #include "cerberus.h" -/* The number of seconds before the program times out */ -#ifndef TIMEOUT_SECONDS -#define TIMEOUT_SECONDS 60 -#endif - - - /** * Mane method * @@ -91,7 +84,7 @@ int main(int argc, char** argv) break; } else - fprintf(stderr, "%s: unrecognised options: -%c\n", *argv, c); + printf("%s: unrecognised options: -%c\n", *argv, c); else if (hostname_on_next) { hostname = arg; @@ -108,6 +101,7 @@ int main(int argc, char** argv) { printf("%s: no username specified\n", *argv); reenable_echo(); + sleep(ERROR_SLEEP); return 2; } @@ -135,6 +129,9 @@ int main(int argc, char** argv) alarm(TIMEOUT_SECONDS); + /* Get user information */ + + /* Get the passphrase, if -f has not been used */ if (skip_auth == 0) { diff --git a/src/cerberus.h b/src/cerberus.h index aeb41c2..c2ea2af 100644 --- a/src/cerberus.h +++ b/src/cerberus.h @@ -19,8 +19,15 @@ #include <stdio.h> #include <unistd.h> #include <signal.h> +#include <pwd.h> #include "passphrase.h" #include "quit.h" #include "security.h" + +/* The number of seconds before the program times out */ +#ifndef TIMEOUT_SECONDS +#define TIMEOUT_SECONDS 60 +#endif + @@ -22,6 +22,12 @@ #include "passphrase.h" +/* Number of seconds to sleep on error, so the user has time to read the error message */ +#ifndef ERROR_SLEEP +#define ERROR_SLEEP 2 +#endif + + /** * Quit function for timeout * @@ -29,7 +35,6 @@ */ void timeout_quit(int signal); - /** * Quit function for user aborts * |