From: Jaroslav Kysela Date: Sat, 27 Oct 2018 08:39:44 +0000 (+0200) Subject: access: set the temporary ticket lifetime between 30 and 3600 seconds X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7eacfe7a75da4c64498c2a7be30b734de71236d;p=thirdparty%2Ftvheadend.git access: set the temporary ticket lifetime between 30 and 3600 seconds --- diff --git a/src/access.c b/src/access.c index 02953765b..abb4d9263 100644 --- a/src/access.c +++ b/src/access.c @@ -122,7 +122,7 @@ access_ticket_timeout(void *aux) const char * access_ticket_create(const char *resource, access_t *a) { - const int64_t lifetime = sec2mono(config.ticket_expires); + const int64_t lifetime = sec2mono(MINMAX(config.ticket_expires, 30, 3600)); uint8_t buf[20]; char id[41]; uint_fast32_t i; diff --git a/src/config.c b/src/config.c index cd4d31046..127acc91b 100644 --- a/src/config.c +++ b/src/config.c @@ -2396,7 +2396,7 @@ const idclass_t config_class = { }, { .type = PT_U32, - .intextra = INTEXTRA_RANGE(1, 0x7ff, 1), + .intextra = INTEXTRA_RANGE(30, 3600, 1), .id = "ticket_expires", .name = N_("Ticket expiration (seconds)"), .desc = N_("The number of seconds in which authentication tickets generated by "