diff options
author | Jose Bollo <jose.bollo@iot.bzh> | 2019-10-09 18:40:39 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-10-15 22:06:24 +0200 |
commit | b5fdd44014207c619b937e5c202ba27e77a2593c (patch) | |
tree | 37707b622fbf3a85d87436001c4a7cb196447067 /src/main-cynagoracli.c | |
parent | d719343871969bd06f575b870d28296504433b55 (diff) |
Add no-caching feature
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/main-cynagoracli.c')
-rw-r--r-- | src/main-cynagoracli.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main-cynagoracli.c b/src/main-cynagoracli.c index db36243..af84760 100644 --- a/src/main-cynagoracli.c +++ b/src/main-cynagoracli.c @@ -334,9 +334,12 @@ int get_csupve(int ac, char **av, int *used, const char *def) key.user = n > 3 ? av[3] : def; key.permission = n > 4 ? av[4] : def; value.value = n > 5 ? av[5] : "no"; - value.expire = n > 6 ? txt2exp(av[6]) : 0; + if (n <= 6) + value.expire = 0; + else if (!txt2exp(av[6], &value.expire)) + return -EINVAL; - return key.client && key.session && key.user && key.permission && value.value && value.expire >= 0 ? 0 : -EINVAL; + return key.client && key.session && key.user && key.permission && value.value ? 0 : -EINVAL; } int get_csup(int ac, char **av, int *used, const char *def) |