Page MenuHomeFreeBSD

usr.sbin/praudit: fix tests after 5619d49e07
ClosedPublic

Authored by arichardson on Tue, Feb 2, 3:21 PM.

Details

Summary

Commit 5619d49e07 made the getgrgid() call inside bsm work as
intended so we now print "wheel" instead of a numeric 0 in the rgid field.

Test Plan

Before: 2/10 passed (8 failed)
After: 10/10 passed (0 failed)

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

The old tests still pass on my system (built Jan-9-2021). Can you figure out what's different about yours?

The old tests still pass on my system (built Jan-9-2021). Can you figure out what's different about yours?

I built d21ce74dcce6f8b69451b3b2dd291d35cbb70609 with D28451. The tests are failing on RISC-V/AArch64/Amd64 and I can't see any obvious commits since 9th Jan.

The old tests still pass on my system (built Jan-9-2021). Can you figure out what's different about yours?

I built d21ce74dcce6f8b69451b3b2dd291d35cbb70609 with D28451. The tests are failing on RISC-V/AArch64/Amd64 and I can't see any obvious commits since 9th Jan.

Yes, it fails for me too, now that I've updated. From the source code of openbsm, it looks like getgrgid wasn't working before, and is now. The change might be related to the recently fixed https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252094 or https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=165527 ?

arichardson retitled this revision from usr.sbin/praudit: fix tests to usr.sbin/praudit: fix tests after 5619d49e07.Wed, Feb 3, 9:50 AM
arichardson edited the summary of this revision. (Show Details)
arichardson edited the test plan for this revision. (Show Details)
arichardson added a reviewer: markj.

I just ran the tests with 5619d49e07d3942e438f3d06269f3c1c466cf5b7 built and they fail, whereas with commit 7abc10098b3d9c23d611294714b3058e8048aec0 (the one before) they still print the numeric 0.

Thanks for fixing this and sorry for the breakage. I had run a subset of the test suite but clearly should have run the whole thing.

The problem seems to be that praudit() expects setgroupent(1) to work since it runs in capability mode and can't open the group database after initialization. 48a186863431ec7a23c6174bc376cafa59dd5fbf fixes that. I suspect running the tests with kern.trap_enotcap=1 would cause them to crash before the fix.

This revision is now accepted and ready to land.Wed, Feb 3, 1:53 PM