Page MenuHomeFreeBSD

id: Clean up
AbandonedPublic

Authored by des on Oct 23 2025, 5:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 24, 11:34 PM
Unknown Object (File)
Mon, Nov 10, 7:59 AM
Unknown Object (File)
Sun, Nov 9, 9:38 PM
Unknown Object (File)
Fri, Nov 7, 9:21 PM
Unknown Object (File)
Tue, Nov 4, 5:21 PM
Unknown Object (File)
Oct 28 2025, 5:29 PM
Unknown Object (File)
Oct 26 2025, 10:39 AM
Unknown Object (File)
Oct 26 2025, 10:38 AM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Oct 23 2025, 5:22 PM
obrien added inline comments.
usr.bin/id/id.c
467–485

Why are these in this review, which doesn't consume them, instead of being part of D53301? That's where they really belong IMHO.

Can you add a summary in the commit log message instead of just "id: Clean up"

des marked an inline comment as done.Oct 23 2025, 6:52 PM
des added inline comments.
usr.bin/id/id.c
467–485

yes, that was a mistake, sorry

des marked an inline comment as done.Oct 23 2025, 7:02 PM

If I didn't cross my eye too much, this is good. Bool math is cool...

This revision is now accepted and ready to land.Oct 28 2025, 4:04 PM
This revision was automatically updated to reflect the committed changes.
modul_r2bdl.top added a subscriber: modul_r2bdl.top.

Sympthom: unable to compile world at stable/15 branch, broken preprocessor logic

Error:

> usr.bin/id (all)

cc -target x86_64-unknown-freebsd15.0 --sysroot=/usr/obj/usr/src/amd64.amd64/tmp -B/usr/obj/usr/src/amd64.amd64/tmp/usr/bin -fpie -DPIC -O2 -pipe -fno-common -march=cascadelake -fPIE -DNDEBUG -ffile-prefix-map=/usr/src=/usr/src
-ffile-prefix-map=/usr/obj/usr/src=/usr/obj -MD -MF.depend.id.pieo -MTid.pieo -std=gnu17 -Wno-format-zero-length -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Wnested-externs -Wold-style-definition -Wno-pointer-sign -Wdate-time -Wmissing-variable-declarations -Wthread-safety
-Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-parameter -Wno-error=cast-function-type-mismatch -Qunused-arguments -c /usr/src/usr.bin/id/id.c -o id.pieo
/usr/src/usr.bin/id/id.c:149:16: error: use of undeclared identifier 'Aflag'

149 |         if ((cflag || Aflag || Mflag) && argc > 0)
    |                       ^

/usr/src/usr.bin/id/id.c:152:10: error: use of undeclared identifier 'Aflag'

152 |         combo = Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag;
    |                 ^

2 errors generated.

Cause: using undeclared 'Aflag' when WITHOUT_AUDIT option is in src.conf

#ifdef USE_BSM_AUDIT                                                                                                                                                                                                                           
        bool Aflag;
#endif                                                                                                                                                                                                                                         
#ifdef USE_BSM_AUDIT                                                                                                                                                                                                                           
        Aflag = false;
#endif

And then:

if ((cflag || Aflag || Mflag) && argc > 0)
combo = Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag;

Solution: should always declare Aflag or use #ifdef with any further statements with this var