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
This commit is contained in:
Ed Maste
2024-10-23 08:25:29 -04:00
parent 3b65da5b65
commit ba10bfe509
+2 -2
View File
@@ -644,7 +644,7 @@ print_user(FILE *fp, u_int32_t usr, int oflags)
{ {
struct passwd *pwent; struct passwd *pwent;
if (oflags & AU_OFLAG_RAW) if (oflags & (AU_OFLAG_RAW | AU_OFLAG_NORESOLVE))
fprintf(fp, "%d", usr); fprintf(fp, "%d", usr);
else { else {
pwent = getpwuid(usr); pwent = getpwuid(usr);
@@ -663,7 +663,7 @@ print_group(FILE *fp, u_int32_t grp, int oflags)
{ {
struct group *grpent; struct group *grpent;
if (oflags & AU_OFLAG_RAW) if (oflags & (AU_OFLAG_RAW | AU_OFLAG_NORESOLVE))
fprintf(fp, "%d", grp); fprintf(fp, "%d", grp);
else { else {
grpent = getgrgid(grp); grpent = getgrgid(grp);