diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 12:49:00 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-10-29 15:07:35 +0100 |
commit | 1a5153117784c267ceb81c048dd5e9b9c4309fbb (patch) | |
tree | 23b5b83b5a8e76c4ed1463e8f93980564f2c3ebd /src/json.c | |
parent | 48636e1fe6f6d3141de735f9faf4c359938b837c (diff) |
src: default to numeric UID and GID listing
Like iptables-save, print UID and GID as numeric values by default.
Add a new option `-u' to print the UID and GID names as defined by
/etc/passwd and /etc/group.
Note that -n is ignored after this patch, since default are numeric
printing for UID and GID.
Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1021,7 +1021,7 @@ json_t *uid_type_json(const struct expr *expr, struct output_ctx *octx) { uint32_t uid = mpz_get_uint32(expr->value); - if (octx->numeric < NFT_NUMERIC_ALL) { + if (nft_output_guid(octx)) { struct passwd *pw = getpwuid(uid); if (pw) @@ -1034,7 +1034,7 @@ json_t *gid_type_json(const struct expr *expr, struct output_ctx *octx) { uint32_t gid = mpz_get_uint32(expr->value); - if (octx->numeric < NFT_NUMERIC_ALL) { + if (nft_output_guid(octx)) { struct group *gr = getgrgid(gid); if (gr) |