Page MenuHomeFreeBSD

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

Authored by olce on Fri, Nov 15, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 9:59 PM
Unknown Object (File)
Tue, Nov 26, 10:19 PM
Unknown Object (File)
Tue, Nov 26, 10:19 PM
Unknown Object (File)
Tue, Nov 26, 9:39 PM
Unknown Object (File)
Sat, Nov 23, 7:42 AM
Unknown Object (File)
Thu, Nov 21, 6:41 PM
Unknown Object (File)
Tue, Nov 19, 9:21 AM
Unknown Object (File)
Tue, Nov 19, 12:45 AM

Details

Reviewers
bapt
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 60808
Build 57692: arc lint + arc unit

Event Timeline

olce requested review of this revision.Fri, Nov 15, 5:08 PM
This revision is now accepted and ready to land.Tue, Nov 19, 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.Wed, Nov 27, 10:12 AM
This revision is now accepted and ready to land.Mon, Dec 2, 8:55 AM