Page MenuHomeFreeBSD

setclasspriority(): New value 'inherit'
ClosedPublic

Authored by olce on Jun 21 2023, 1:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 12:51 PM
Unknown Object (File)
Fri, Apr 26, 12:56 AM
Unknown Object (File)
Mar 30 2024, 5:50 PM
Unknown Object (File)
Mar 19 2024, 5:30 AM
Unknown Object (File)
Mar 19 2024, 5:30 AM
Unknown Object (File)
Mar 19 2024, 5:30 AM
Unknown Object (File)
Mar 19 2024, 5:30 AM
Unknown Object (File)
Mar 17 2024, 10:03 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 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