Bug 271751 - setusercontext(): Allow setting priority from '~/.login_conf'
Summary: setusercontext(): Allow setting priority from '~/.login_conf'
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 16:16 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 16:16:59 UTC
Allow users to set their priority in '.login_conf' (use case: lower the default priority for all processes).  Of course, unprivileged users cannot actually raise their process priorities that way.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-01-29 22:32:54 UTC
A commit in branch main references this bug:

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

commit f2a0277d3e51a6a839151eef17f466d0db2b7300
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-05-30 15:14:50 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-01-29 21:58:09 +0000

    setusercontext(): Set priority from '~/.login_conf' as well

    Setting the process priority is done only when the current process'
    effective UID corresponds to that for which context is to be set.
    Consequently, setting priority is done with appropriate credentials and
    will fail if the target user tries to raise it unduly via his
    '~/.login_conf'.

    PR:                     271751
    Reviewed by:            kib, Andrew Gierth <andrew_tao173.riddles.org.uk>
    Approved by:            emaste (mentor)
    MFC after:              3 days
    Relnotes:               yes
    Sponsored by:           Kumacom SAS
    Differential Revision:  https://reviews.freebsd.org/D40352

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

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

commit 8b359002747a3ce84414fb64a9b89eab20ab7c25
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-05-30 15:14:50 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-02-01 21:24:13 +0000

    setusercontext(): Set priority from '~/.login_conf' as well

    Setting the process priority is done only when the current process'
    effective UID corresponds to that for which context is to be set.
    Consequently, setting priority is done with appropriate credentials and
    will fail if the target user tries to raise it unduly via his
    '~/.login_conf'.

    PR:                     271751
    Reviewed by:            kib, Andrew Gierth <andrew_tao173.riddles.org.uk>
    Approved by:            emaste (mentor)
    MFC after:              3 days
    Relnotes:               yes
    Sponsored by:           Kumacom SAS
    Differential Revision:  https://reviews.freebsd.org/D40352

    (cherry picked from commit f2a0277d3e51a6a839151eef17f466d0db2b7300)

    Approved by:            markj (mentor)

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

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

commit d2d66fedc418a9bccbe4ea92345f269106d6af32
Author:     Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2023-05-30 15:14:50 +0000
Commit:     Olivier Certner <olce@FreeBSD.org>
CommitDate: 2024-02-01 21:30:08 +0000

    setusercontext(): Set priority from '~/.login_conf' as well

    Setting the process priority is done only when the current process'
    effective UID corresponds to that for which context is to be set.
    Consequently, setting priority is done with appropriate credentials and
    will fail if the target user tries to raise it unduly via his
    '~/.login_conf'.

    PR:                     271751
    Reviewed by:            kib, Andrew Gierth <andrew_tao173.riddles.org.uk>
    Approved by:            emaste (mentor)
    MFC after:              3 days
    Relnotes:               yes
    Sponsored by:           Kumacom SAS
    Differential Revision:  https://reviews.freebsd.org/D40352

    (cherry picked from commit f2a0277d3e51a6a839151eef17f466d0db2b7300)

    Approved by:            markj (mentor)

 lib/libutil/login_class.c | 2 ++
 1 file changed, 2 insertions(+)