From: Martin Mares Date: Wed, 6 Sep 2017 21:06:34 +0000 (+0200) Subject: When listing zones, include temp token validity limit X-Git-Tag: v0.9~18 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=64f6505503a1ef4197c3088b6b7b4e20af6a9aec;p=subauth.git When listing zones, include temp token validity limit --- diff --git a/client/subauth.c b/client/subauth.c index 9c65297..44c9fef 100644 --- a/client/subauth.c +++ b/client/subauth.c @@ -275,7 +275,7 @@ static void cmd_zones(void) op_run(); struct json_node **jzs = need_child(rp, "zones", JSON_ARRAY)->elements; - printf("%-16s %6s %6s %s\n", "Zone", "Passwd", "Tokens", "Description"); + printf("%-16s %6s %6s %6s %s\n", "Zone", "Passwd", "Tokens", "MaxTmp", "Description"); for (uint i=0; i < GARY_SIZE(jzs); i++) { struct json_node *jz = jzs[i]; @@ -283,10 +283,12 @@ static void cmd_zones(void) struct json_node *jdesc = get_child(jz, "desc", JSON_STRING); struct json_node *jpass = get_child(jz, "allow-passwd", JSON_NUMBER); struct json_node *jtokens = get_child(jz, "allow-tokens", JSON_NUMBER); - printf("%-16s %6s %6d %s\n", + struct json_node *jtemp = get_child(jz, "max-temp-validity", JSON_NUMBER); + printf("%-16s %6s %6d %6d %s\n", jname->string, (jpass && jpass->number ? "yes" : "-"), (jtokens ? (uint) jtokens->number : 0), + (jtemp ? (uint) jtemp->number : 0), (jdesc ? jdesc->string : "(no description)")); } } diff --git a/server/cmd.c b/server/cmd.c index 106d1ef..fb8d698 100644 --- a/server/cmd.c +++ b/server/cmd.c @@ -496,6 +496,7 @@ static void cmd_list_zones(struct client *c) set_string(c, jz, "desc", az->desc); set_uint(c, jz, "allow-passwd", az->allow_passwd); set_uint(c, jz, "allow-tokens", az->allow_tokens); + set_uint(c, jz, "max-temp-validity", az->max_temp_validity); } cmd_ok(c);