diff --git a/security/sssd2/Makefile b/security/sssd2/Makefile
index 3a73e0260ec4667f7b82c1ed86d92dca297fdf8c..b0fc081d536a40d0e1ddb87e2d8da3dea08607ed 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 40f9022a5f9daa9352d35dec6b669170cb4fa512..9892baab0f4cabe573d1d4dcae78817e24fc9f37 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;
 +        }
 +