Page MenuHomeFreeBSD

setclasspriority(): New value 'inherit'
ClosedPublic

Authored by olce on Jun 21 2023, 1:54 PM.
Tags
None
Referenced Files
F103309912: D40690.diff
Sat, Nov 23, 9:33 AM
F103300116: D40690.id123602.diff
Sat, Nov 23, 6:24 AM
Unknown Object (File)
Thu, Nov 21, 5:27 PM
Unknown Object (File)
Thu, Nov 21, 10:39 AM
Unknown Object (File)
Thu, Nov 21, 6:46 AM
Unknown Object (File)
Thu, Nov 21, 2:16 AM
Unknown Object (File)
Wed, Nov 20, 2:57 AM
Unknown Object (File)
Tue, Nov 19, 7:40 PM

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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

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

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
469–470

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