Page MenuHomeFreeBSD

setclasspriority(): New value 'inherit'
ClosedPublic

Authored by olce on Jun 21 2023, 1:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 11:33 AM
Unknown Object (File)
Wed, Nov 6, 9:27 PM
Unknown Object (File)
Wed, Nov 6, 2:32 PM
Unknown Object (File)
Wed, Nov 6, 9:49 AM
Unknown Object (File)
Tue, Nov 5, 9:53 AM
Unknown Object (File)
Mon, Nov 4, 5:34 PM
Unknown Object (File)
Sat, Nov 2, 2:42 AM
Unknown Object (File)
Sat, Nov 2, 2:42 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