Bug 271749 - setusercontext(), login.conf: Only set priority if explicit in the login class specification
Summary: setusercontext(), login.conf: Only set priority if explicit in the login clas...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Olivier Certner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-31 15:56 UTC by Olivier Certner
Modified: 2024-02-01 21:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Olivier Certner freebsd_committer freebsd_triage 2023-05-31 15:56:55 UTC
This allows not modifying priorities for selected login classes (or 'default' on
custom-built systems).

This also fixes inconsistent behavior compared to what is done for all other
contexts: 'umask', 'cpumask', resource limits, etc., and aligns with what the
login.conf(5) manual page says.

While here, polish the syslog messages to contain readily useful information.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-01-29 22:32:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d162d7e2ad327ceada4102c5d6779f9ecd809502

commit d162d7e2ad327ceada4102c5d6779f9ecd809502
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-06-21 08:53:37 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-01-29 21:58:09 +0000

    setclasspriority(): New possible value 'inherit'

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

    PR:                     271749
    Reviewed by:            emaste, yuripv
    Approved by:            emaste (mentor)
    MFC after:              3 days
    Relnotes:               yes
    Sponsored by:           Kumacom SAS
    Differential Revision:  https://reviews.freebsd.org/D40690

 lib/libutil/login_class.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-02-01 21:26:41 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e074746fec21fbc4a66e936408e3b585f89b73bd

commit e074746fec21fbc4a66e936408e3b585f89b73bd
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-06-21 08:53:37 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-02-01 21:23:59 +0000

    setclasspriority(): New possible value 'inherit'

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

    PR:                     271749
    Reviewed by:            emaste, yuripv
    Approved by:            emaste (mentor)
    MFC after:              3 days
    Relnotes:               yes
    Sponsored by:           Kumacom SAS
    Differential Revision:  https://reviews.freebsd.org/D40690

    (cherry picked from commit d162d7e2ad327ceada4102c5d6779f9ecd809502)

    Approved by:            markj (mentor)

 lib/libutil/login_class.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-02-01 21:31:48 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a8c273b3c97fa3d0eaf566136d3784257f137d6e

commit a8c273b3c97fa3d0eaf566136d3784257f137d6e
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-06-21 08:53:37 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-02-01 21:29:55 +0000

    setclasspriority(): New possible value 'inherit'

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

    PR:                     271749
    Reviewed by:            emaste, yuripv
    Approved by:            emaste (mentor)
    MFC after:              3 days
    Relnotes:               yes
    Sponsored by:           Kumacom SAS
    Differential Revision:  https://reviews.freebsd.org/D40690

    (cherry picked from commit d162d7e2ad327ceada4102c5d6779f9ecd809502)

    Approved by:            markj (mentor)

 lib/libutil/login_class.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)