From 5d96862c4513f0a1caeb2331572c342620c22e5c Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 17 Oct 2025 18:59:13 +0000 Subject: [PATCH] lifetime maxval; closes #926 --- copyparty/authsrv.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 2ac3cd09..6bcb7d6e 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -2597,6 +2597,15 @@ class AuthSrv(object): for x in drop: vol.flags.pop(x) + zi = vol.flags.get("lifetime") or 0 + zi2 = time.time() // (86400 * 365) + zi3 = zi2 * 86400 * 365 + if zi < 0 or zi > zi3: + t = "the lifetime of volume [/%s] (%d) exceeds max value (%d years; %d)" + t = t % (vol.vpath, zi, zi2, zi3) + self.log(t, 1) + raise Exception(t) + # verify tags mentioned by -mt[mp] are used by -mte local_mtp = {} local_only_mtp = {}