Page MenuHomeFreeBSD

MAC/do: 'struct rule': IDs and types as 'u_int', rename fields
ClosedPublic

Authored by olce on Nov 15 2024, 5:08 PM.
Tags
None
Referenced Files
F111339849: D47613.id147027.diff
Sun, Mar 2, 2:11 PM
F111328739: D47613.id147027.diff
Sun, Mar 2, 10:37 AM
Unknown Object (File)
Sat, Feb 22, 9:40 PM
Unknown Object (File)
Jan 10 2025, 8:58 AM
Unknown Object (File)
Jan 8 2025, 7:26 AM
Unknown Object (File)
Dec 27 2024, 10:20 AM
Unknown Object (File)
Dec 27 2024, 9:52 AM
Unknown Object (File)
Dec 27 2024, 9:13 AM

Details

Summary

This revision is part of a series. Click on the Stack tab below to see the context.
This series has also been squeezed into D47633 to provide an overall view.

Commit message:
This is in preparation for introducing a common conversion function for
IDs and to simplify code a bit by removing the from-IDs union and not
having to introduce a new one for to-IDs in a later commit.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60604
Build 57488: arc lint + arc unit

Event Timeline

olce requested review of this revision.Nov 15 2024, 5:08 PM
This revision is now accepted and ready to land.Nov 19 2024, 8:06 AM
sys/security/mac_do/mac_do.c
47–48

TODO: Re-reading this code, I think (int)(uid_t)-1 == -1 doesn't match my intent as it will always be considered true by any decent compiler on 2-complement machines and consequently cannot detect if uid_t is effectively a signed type.

olce retitled this revision from MAC/do: 'struct rule': IDs as int, rename fields to MAC/do: 'struct rule': IDs and types as 'u_int', rename fields.

Use u_int instead of int, as uid_t and gid_t are in fact unsigned integers, and not signed ones as I initially assumed. (Since we are compiling with -fwrapv, this doesn't matter for correctness of execution, but is conceptually wrong.)

This revision now requires review to proceed.Nov 27 2024, 10:12 AM
This revision is now accepted and ready to land.Dec 2 2024, 8:55 AM