From 7dcda352a609d063098e238db09c03cdc25c564b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 13 Apr 2011 21:42:46 +0200 Subject: ask-password: support passwords without timeouts --- src/tty-ask-password-agent.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/tty-ask-password-agent.c') 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) -- cgit v1.2.3-54-g00ecf