summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tty-ask-password-agent.c')
-rw-r--r--src/tty-ask-password-agent.c12
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)