Page MenuHomeFreeBSD

setclasspriority(): New value 'inherit'
ClosedPublic

Authored by olce on Jun 21 2023, 1:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 14, 11:52 AM
Unknown Object (File)
Mon, May 13, 10:56 PM
Unknown Object (File)
Mon, May 13, 10:56 PM
Unknown Object (File)
Mon, May 13, 10:37 PM
Unknown Object (File)
Sun, May 12, 11:55 AM
Unknown Object (File)
Sun, May 12, 7:57 AM
Unknown Object (File)
Wed, May 8, 11:48 AM
Unknown Object (File)
Sun, May 5, 7:20 AM

Details

Summary

It indicates to the login.conf machinery (setusercontext()/setclasscontext()) to
leave priority alone, effectively inheriting it from the parent process.

Diff Detail

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

Event Timeline

olce requested review of this revision.Jun 21 2023, 1:54 PM
lib/libutil/login_class.c
472

why do you need to use the ret variable at all, and not just compare the return value of login_getcapenum() here?

Remove ret variable, call login_capgetenum() in the test directly

This is a leftover of a time I had envisioned to log selective messages
depending on the error, but in the end I don't think it would be particularly
useful. Lots of other calls into login_class(3) or login_cap(3) can fail in
"unexpected" ways (out of memory, programming error) and this is not currently
treated specially. These are bugs (and even potentially security ones) that
should be solved as separate work. login_capgetenum() is nor better nor worse
in this respect.

emaste added inline comments.
lib/libutil/login_class.c
473–474

Personally I would either put braces around the block, or move the comment before the if (e.g. /* Do nothing if the priority is "inherit". */)

Even though it's still only a single statement I think the braces improve clarity when it's more than one line.

olce marked an inline comment as done.

Address suggestions (move a comment out of an if).

This revision is now accepted and ready to land.Jan 29 2024, 5:45 PM