Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 2025 17:59:51 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 7b3028c92e9d - main - security/sssd2: Fix two bugs in the find_uid patch
Message-ID:  <202502041759.514Hxp0A062479@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7b3028c92e9d74b96c801355ad68b16d9aa22a62

commit 7b3028c92e9d74b96c801355ad68b16d9aa22a62
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2025-01-15 19:59:24 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2025-02-04 17:59:22 +0000

    security/sssd2: Fix two bugs in the find_uid patch
    
    The UID check was added in commit 9a40ff81f4ea ("security/sssd2:
    Reimplement UID-finding using sysctl") and is supposed to exclude kernel
    processes, retaining the behaviour of commit ee81c8e455ef
    ("security/sssd2: Add patch to enumerate UIDs").
    
    However, it mistakenly skipped over processes with UID 0, which could
    cause the lookup to fail.  Fix the typo.
    
    Also return success if the caller asked us to populate a table and no
    entries were added.  This matches the previous behaviour.
    
    PR:             284089
    Approved by:    jhixson (maintainer timeout)
    Reviewed by:    arrowd
    Sponsored by:   Klara, Inc.
---
 security/sssd2/Makefile                          | 1 +
 security/sssd2/files/patch-src__util__find_uid.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/security/sssd2/Makefile b/security/sssd2/Makefile
index 3a73e0260ec4..b0fc081d536a 100644
--- a/security/sssd2/Makefile
+++ b/security/sssd2/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	sssd
 PORTVERSION=	2.9.6
+PORTREVISION=	1
 CATEGORIES=	security
 PKGNAMESUFFIX=	2
 
diff --git a/security/sssd2/files/patch-src__util__find_uid.c b/security/sssd2/files/patch-src__util__find_uid.c
index 40f9022a5f9d..9892baab0f4c 100644
--- a/security/sssd2/files/patch-src__util__find_uid.c
+++ b/security/sssd2/files/patch-src__util__find_uid.c
@@ -52,9 +52,9 @@
 +        return err;
 +    }
 +
-+    err = ENOENT;
++    err = table != NULL ? 0 : ENOENT;
 +    for (size_t i = 0; i < sz / sizeof(struct kinfo_proc); i++) {
-+        if (kp[i].ki_uid == 0) {
++        if (kp[i].ki_pid == 0) {
 +            continue;
 +        }
 +



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502041759.514Hxp0A062479>