Fix Linux uid 0

This commit is contained in:
Xavier Beaudouin
2024-05-22 09:30:21 +02:00
parent d34bff2120
commit e2fb7adf65
2 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= sssd PORTNAME= sssd
PORTVERSION= 2.9.4 PORTVERSION= 2.9.4
PORTREVISION= 11 PORTREVISION= 12
CATEGORIES= security CATEGORIES= security
PKGNAMESUFFIX= 2 PKGNAMESUFFIX= 2

View File

@ -1,4 +1,4 @@
--- src/util/find_uid.c.orig 2024-05-17 14:50:42 UTC --- src/util/find_uid.c.orig 2024-01-12 12:05:40 UTC
+++ src/util/find_uid.c +++ src/util/find_uid.c
@@ -71,7 +71,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t @@ -71,7 +71,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t
uint32_t num=0; uint32_t num=0;
@ -9,6 +9,15 @@
if (ret < 0) { if (ret < 0) {
DEBUG(SSSDBG_CRIT_FAILURE, "snprintf failed\n"); DEBUG(SSSDBG_CRIT_FAILURE, "snprintf failed\n");
return EINVAL; return EINVAL;
@@ -212,7 +212,7 @@ static errno_t name_to_pid(const char *name, pid_t *pi
return EINVAL;
}
- if (num <= 0 || num >= INT_MAX) {
+ if (num < 0 || num >= INT_MAX) {
DEBUG(SSSDBG_CRIT_FAILURE, "pid out of range.\n");
return ERANGE;
}
@@ -240,7 +240,7 @@ static errno_t get_active_uid_linux(hash_table_t *tabl @@ -240,7 +240,7 @@ static errno_t get_active_uid_linux(hash_table_t *tabl
hash_key_t key; hash_key_t key;
hash_value_t value; hash_value_t value;