Skip to content
Snippets Groups Projects
Commit 7b3028c9 authored by Mark Johnston's avatar Mark Johnston
Browse files

security/sssd2: Fix two bugs in the find_uid patch

The UID check was added in commit 9a40ff81 ("security/sssd2:
Reimplement UID-finding using sysctl") and is supposed to exclude kernel
processes, retaining the behaviour of commit ee81c8e4
("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.
parent d7853cdf
No related branches found
No related tags found
No related merge requests found
PORTNAME= sssd PORTNAME= sssd
PORTVERSION= 2.9.6 PORTVERSION= 2.9.6
PORTREVISION= 1
CATEGORIES= security CATEGORIES= security
PKGNAMESUFFIX= 2 PKGNAMESUFFIX= 2
......
...@@ -52,9 +52,9 @@ ...@@ -52,9 +52,9 @@
+ return err; + return err;
+ } + }
+ +
+ err = ENOENT; + err = table != NULL ? 0 : ENOENT;
+ for (size_t i = 0; i < sz / sizeof(struct kinfo_proc); i++) { + 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; + continue;
+ } + }
+ +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment