diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-04-13 21:42:46 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-04-13 21:42:46 +0200 |
commit | 7dcda352a609d063098e238db09c03cdc25c564b (patch) | |
tree | 545a8c2f76af39cae406633c5bc181824ae076cc /src/tty-ask-password-agent.c | |
parent | d55f4f3f92f56f76bdd06192d6a2ef3ee9fe4772 (diff) |
ask-password: support passwords without timeouts
Diffstat (limited to 'src/tty-ask-password-agent.c')
-rw-r--r-- | src/tty-ask-password-agent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tty-ask-password-agent.c b/src/tty-ask-password-agent.c index a414cba374..4a29abacbb 100644 --- a/src/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent.c @@ -261,7 +261,6 @@ static int parse_password(const char *filename, char **wall) { FILE *f; int r; - usec_t n; assert(filename); @@ -279,16 +278,17 @@ static int parse_password(const char *filename, char **wall) { goto finish; } - if (!socket_name || not_after <= 0) { + if (!socket_name) { log_error("Invalid password file %s", filename); r = -EBADMSG; goto finish; } - n = now(CLOCK_MONOTONIC); - if (n > not_after) { - r = 0; - goto finish; + if (not_after > 0) { + if (now(CLOCK_MONOTONIC) > not_after) { + r = 0; + goto finish; + } } if (arg_action == ACTION_LIST) |