summaryrefslogtreecommitdiff
path: root/src/tty-ask-password-agent.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-13 21:42:46 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-13 21:42:46 +0200
commit7dcda352a609d063098e238db09c03cdc25c564b (patch)
tree545a8c2f76af39cae406633c5bc181824ae076cc /src/tty-ask-password-agent.c
parentd55f4f3f92f56f76bdd06192d6a2ef3ee9fe4772 (diff)
ask-password: support passwords without timeouts
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)