From 1a5153117784c267ceb81c048dd5e9b9c4309fbb Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 29 Oct 2018 12:49:00 +0100 Subject: 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 Signed-off-by: Pablo Neira Ayuso --- src/meta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/meta.c') diff --git a/src/meta.c b/src/meta.c index 3677561b..c8a7b13b 100644 --- a/src/meta.c +++ b/src/meta.c @@ -207,7 +207,7 @@ static void uid_type_print(const struct expr *expr, struct output_ctx *octx) { struct passwd *pw; - if (octx->numeric < NFT_NUMERIC_ALL) { + if (nft_output_guid(octx)) { uint32_t uid = mpz_get_uint32(expr->value); pw = getpwuid(uid); @@ -260,7 +260,7 @@ static void gid_type_print(const struct expr *expr, struct output_ctx *octx) { struct group *gr; - if (octx->numeric < NFT_NUMERIC_ALL) { + if (nft_output_guid(octx)) { uint32_t gid = mpz_get_uint32(expr->value); gr = getgrgid(gid); -- cgit v1.2.3