Page MenuHomeFreeBSD

MAC/do: Output errors when parsing rules
ClosedPublic

Authored by olce on Nov 15 2024, 5:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 14, 2:33 PM
Unknown Object (File)
Sun, Jan 12, 5:52 AM
Unknown Object (File)
Fri, Dec 27, 11:16 AM
Unknown Object (File)
Fri, Dec 27, 7:37 AM
Unknown Object (File)
Fri, Dec 27, 12:57 AM
Unknown Object (File)
Thu, Dec 26, 1:21 PM
Unknown Object (File)
Thu, Dec 26, 8:08 AM
Unknown Object (File)
Dec 9 2024, 1:33 PM

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:
So that administrators can more easily know what the problem is with the
rules they are trying to set.

The new sysctl 'security.mac.do.print_parse_error' controls whether
trying to set sysctl 'security.mac.do.rules' with invalid rules triggers
printing of the error on the system console.

Setting jail parameters directlty reports an error to the calling
process thanks to the VFS options mechanism used by the jail machinery,
so is not controlled by the new sysctl setting.

Diff Detail

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

Event Timeline

olce requested review of this revision.Nov 15 2024, 5:08 PM

Rename alloc_parse_error() to make_parse_error() (as it is a constructor really, not just an allocator).

Fix style (v & FLAG => (v & FLAG) != 0 and similar).

In coalesce_id_flags(), add an error message for the new error introduced in D47616 and tweak the existing one.

This revision is now accepted and ready to land.Dec 2 2024, 8:56 AM
This revision was automatically updated to reflect the committed changes.