aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2024-10-23 12:25:29 +0000
committerEd Maste <emaste@FreeBSD.org>2024-11-03 18:37:24 +0000
commitba10bfe509dcb5d408de89c886527035068b8f17 (patch)
treef49189a639f9c237e7db034a7699bf51803b1329
parent3b65da5b65a6bfaf1150075e1dab3c627cb32f92 (diff)
libbsm: honour AU_OFLAG_NORESOLVE
AU_OFLAG_NORESOLVE is documented as "Leave user and group IDs in their numeric form" but it was not actually tested. OpenBSM pull request at https://github.com/openbsm/openbsm/pull/85 PR: 282271 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47263
-rw-r--r--contrib/openbsm/libbsm/bsm_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/openbsm/libbsm/bsm_io.c b/contrib/openbsm/libbsm/bsm_io.c
index 4b89ccb8b59c..f0b3e4a1a2df 100644
--- a/contrib/openbsm/libbsm/bsm_io.c
+++ b/contrib/openbsm/libbsm/bsm_io.c
@@ -644,7 +644,7 @@ print_user(FILE *fp, u_int32_t usr, int oflags)
{
struct passwd *pwent;
- if (oflags & AU_OFLAG_RAW)
+ if (oflags & (AU_OFLAG_RAW | AU_OFLAG_NORESOLVE))
fprintf(fp, "%d", usr);
else {
pwent = getpwuid(usr);
@@ -663,7 +663,7 @@ print_group(FILE *fp, u_int32_t grp, int oflags)
{
struct group *grpent;
- if (oflags & AU_OFLAG_RAW)
+ if (oflags & (AU_OFLAG_RAW | AU_OFLAG_NORESOLVE))
fprintf(fp, "%d", grp);
else {
grpent = getgrgid(grp);