From nobody Thu Feb 01 21:31:19 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 4TQsXl48RVz58jDW; Thu, 1 Feb 2024 21:31:19 +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 4TQsXl2g30z4c4s; Thu, 1 Feb 2024 21:31:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823079; 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=C9l7fR1F1hcMZnPqVD5NE4eVz2JKJF7L1LLO1hOYH8c=; b=MES9gqsUd0W3ZzPOVYHdxXmUOVAhwxhUxvu8CXLAgpMtDczxobZqmYwLXqMh2KlMW6tJH9 r6eCcoEJ9AJm4ykZH2A0OR+yD9dkOFdmq8YAEuxmbn9ElbyezU707jyThZPGyQVly5rf5y k61vHxMY0WRhJrCRcOS4koDle2n8fcm98A3oBU++/6KvDgtH1WJRRu200na0A/ohn0RsQK Qf770nagyZ9AeagLTuT0iBXCVYtpkrULMzTIitBu7XyvErDn4mYyZTZ9HuX7gNW1T8NYRs MtoFSFSzD8FhtCNgAaL9pQIlgAv8Bz+7DK6rjbyP+6VUxGa66y/if4FzDmdi9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1706823079; 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=C9l7fR1F1hcMZnPqVD5NE4eVz2JKJF7L1LLO1hOYH8c=; b=Fc9BYR7sQBzw5mq505pZAzqPGMfpSCZf1ltXBuzucZwcRuMjd9gHW4OO1sGLgAM3qhQwcx 8cZvEtHrDKGvCJw1jIfyqZHdzRwCzs6jlrGLQ26zRugdozIOs5y9Qo23ieVUO4U4RgIHhG sCwMmgcFnIqRg+Fy1Sz4I/++s8WhguvBr7FWiaeh+BY4ErWTIZ+kPWOkP2S+ZcZOGj/7RC 8I3vvDa+p7ur6ms6ppvxMuMKDWCVUrrzxDHHw17RE5MdEJeb+ukX12hz1xmxkFNoHoHFvl xf99fXewLl18x2Gdv06LuCs8nD30g+0pEGNgOEY6xV5l2PI0yBojBsNDgT1z/A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1706823079; a=rsa-sha256; cv=none; b=f9e5Fh3AYNeibh3cFP+Cl9ztxrrAsfbqIUen1AqMJPmq+tGfL7LHoMT865EpdREWWc6NHH 6F1s7dw8xalfA5lli7eLcDIE+sUL2UNNlFbsktHKiFkZjgPQNcOwTCPTefQ0SROtTlGSyM R0/+PdQwjz6Z/c/nbGtlKhiooJChzkJB0HWme03zF9RzSmTEPru4UK9fA4y0L3sBoV9v9J R7xbxUNQ4IapPWZEmdbZWPTdHyg0rFuykXcndBAQAxXgiOwCDG6kxtAttnkgnKH4h5dulD IqhWBQVDTSMezfxQwsJiHERZ1ofMtJJqPPOI1q9zzsDNHeszJQHdsYtgvxYdkg== 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 4TQsXl1mmtz1Ht9; Thu, 1 Feb 2024 21:31:19 +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 411LVJHm080912; Thu, 1 Feb 2024 21:31:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 411LVJg3080909; Thu, 1 Feb 2024 21:31:19 GMT (envelope-from git) Date: Thu, 1 Feb 2024 21:31:19 GMT Message-Id: <202402012131.411LVJg3080909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Olivier Certner Subject: git: a8c273b3c97f - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a8c273b3c97fa3d0eaf566136d3784257f137d6e Auto-Submitted: auto-generated The branch stable/14 has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a8c273b3c97fa3d0eaf566136d3784257f137d6e commit a8c273b3c97fa3d0eaf566136d3784257f137d6e Author: Olivier Certner AuthorDate: 2023-06-21 08:53:37 +0000 Commit: Olivier Certner 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(-) diff --git a/lib/libutil/login_class.c b/lib/libutil/login_class.c index 9d8dc652d678..f545e3661520 100644 --- a/lib/libutil/login_class.c +++ b/lib/libutil/login_class.c @@ -463,9 +463,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,