From nobody Mon Jan 29 22:32:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TP32V0wMnz57Zbb; Mon, 29 Jan 2024 22:32:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TP32T6ZbMz4gKF; Mon, 29 Jan 2024 22:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706567537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ru6FMrwuzug5GAUn7NHxW3jPpVo9QRclTHwPQ9EPJY=; b=jAmssm34cZjY2+vmLvBruKc/Hzz0zukCr8+WVgbRzrxhIg3ByP0z1p+zr8it3mIwREx5cy vclqpcCMskJrzkg0WAzpPcOGQXhCKpdF53uakIYkOkqrijKB+7Q3NmBTl3PoqCfOgLtYPt IQzqV9hoaFX0b7GLC+VBTlV2CppKZzirG25StJYmy7zQKBbmHaPYBy0FlIBNGwU6ykwXtL x7WYkUoNCU9xMDwy0g//9Nbf/W6rfbFR31cObMwwb7s/Xv5DmrbIxkRIre2rm6VPhSCqQD VJjdO6LlF8BAWQdrbJA1zf1/4TaCvIXx16bg+vgP3t2FM2XqOEJgo6fjXbZMOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706567537; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ru6FMrwuzug5GAUn7NHxW3jPpVo9QRclTHwPQ9EPJY=; b=Gg3XPpwoeljs1Bx+cPpKzKowKtyp5oY9+voC8eBgsWsoZOJCnDqn6hQv3wjDlDXu02Ynfi qGP+WGr2RC7mezCZyb0R+seZ4wdWuFqpZ2/EAM4YbOUY9Is3L+oACr2Cs6y8qV4/H8LU8l oIIDFTgMQZiYEnZa2EGyOCq53vQxqz0fJx5aYFE9pgdKz6yMatO0/V3i8svHcY5ntlWClA Zpxrz4xjuhqAfqdDIOukdE1PS4aVaL0hV2k1VH0XvnoDlgGV3Eh1bW5GjUTXnajZZDOjrS xIdVRu7aHrYce5wYFbp3Z/10DEPKf3TJHsj1jZAMw6ncIUuz6o4lkgRH3amryA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706567537; a=rsa-sha256; cv=none; b=nA2B4Q6Lvmk/WS165J53/blED+9eFqwbRark47/D6o+6rZwB2piBAYzSDzGokIqKS/hRz4 EUqZrxyyYl/i5mWpMXiAj325a8HuaIkFqoOAAPZM/CYKNO/ujMef+bZUthLzCtQTWZDuXR 3GApRhhhsMi9t0iQcmWVLdxI0ES3fUbdRaTGTwgda8bmiCXsKi1Hgs4rCfSmREyyl7J2GZ 4Bl3zwC9AeSF6fTb8rbuFHj7CnXub/XWkZCKWCiQKyujK/szUogmhk40F34O4GfOiXu0v7 bAECky7djOoWXJwoFqKjWIWm6LzrZo8+JA05BXI/K8/K5/ovd9p7CM8RgCpKog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TP32T5hG5z18hN; Mon, 29 Jan 2024 22:32:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40TMWHB4013774; Mon, 29 Jan 2024 22:32:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40TMWH3o013771; Mon, 29 Jan 2024 22:32:17 GMT (envelope-from git) Date: Mon, 29 Jan 2024 22:32:17 GMT Message-Id: <202401292232.40TMWH3o013771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: d162d7e2ad32 - main - setclasspriority(): New possible value 'inherit' List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d162d7e2ad327ceada4102c5d6779f9ecd809502 Auto-Submitted: auto-generated The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=d162d7e2ad327ceada4102c5d6779f9ecd809502 commit d162d7e2ad327ceada4102c5d6779f9ecd809502 Author: Olivier Certner AuthorDate: 2023-06-21 08:53:37 +0000 Commit: Olivier Certner 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(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index d36926d70224..314ab0999320 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -462,9 +462,15 @@ static void setclasspriority(login_cap_t * const lc, struct passwd const * const pwd) { const rlim_t def_val = LOGIN_DEFPRI, err_val = INT64_MIN; - rlim_t p = login_getcapnum(lc, "priority", def_val, err_val); + rlim_t p; int rc; + /* If value is "inherit", nothing to change. */ + if (login_getcapenum(lc, "priority", inherit_enum) == 0) + return; + + p = login_getcapnum(lc, "priority", def_val, err_val); + if (p == err_val) { /* Invariant: 'lc' != NULL. */ syslog(LOG_WARNING,