]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
access: set the temporary ticket lifetime between 30 and 3600 seconds
authorJaroslav Kysela <perex@perex.cz>
Sat, 27 Oct 2018 08:39:44 +0000 (10:39 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 27 Oct 2018 08:39:44 +0000 (10:39 +0200)
src/access.c
src/config.c

index 02953765b55aa24edfca1b304a888436052043ee..abb4d926369796e0edbb77e588fbcd9a53eb2b3a 100644 (file)
@@ -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;
index cd4d31046c5aa21490c788225ae37af2724e536a..127acc91b296e19603b56f20449e31b210d0a1c9 100644 (file)
@@ -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 "