Added
Link Here
|
1 |
--- src/util/find_uid.c.orig 2024-01-12 12:05:40 UTC |
2 |
+++ src/util/find_uid.c |
3 |
@@ -71,7 +71,7 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t |
4 |
uint32_t num=0; |
5 |
errno_t error; |
6 |
|
7 |
- ret = snprintf(path, PATHLEN, "/proc/%d/status", pid); |
8 |
+ ret = snprintf(path, PATHLEN, "/compat/linux/proc/%d/status", pid); |
9 |
if (ret < 0) { |
10 |
DEBUG(SSSDBG_CRIT_FAILURE, "snprintf failed\n"); |
11 |
return EINVAL; |
12 |
@@ -212,7 +212,7 @@ static errno_t name_to_pid(const char *name, pid_t *pi |
13 |
return EINVAL; |
14 |
} |
15 |
|
16 |
- if (num <= 0 || num >= INT_MAX) { |
17 |
+ if (num < 0 || num >= INT_MAX) { |
18 |
DEBUG(SSSDBG_CRIT_FAILURE, "pid out of range.\n"); |
19 |
return ERANGE; |
20 |
} |
21 |
@@ -240,7 +240,7 @@ static errno_t get_active_uid_linux(hash_table_t *tabl |
22 |
hash_key_t key; |
23 |
hash_value_t value; |
24 |
|
25 |
- proc_dir = opendir("/proc"); |
26 |
+ proc_dir = opendir("/compat/linux/proc"); |
27 |
if (proc_dir == NULL) { |
28 |
ret = errno; |
29 |
DEBUG(SSSDBG_CRIT_FAILURE, "Cannot open proc dir.\n"); |
30 |
@@ -327,9 +327,9 @@ errno_t get_uid_table(TALLOC_CTX *mem_ctx, hash_table_ |
31 |
|
32 |
errno_t get_uid_table(TALLOC_CTX *mem_ctx, hash_table_t **table) |
33 |
{ |
34 |
-#ifdef __linux__ |
35 |
int ret; |
36 |
|
37 |
+#if 1 |
38 |
ret = hash_create_ex(0, table, 0, 0, 0, 0, |
39 |
hash_talloc, hash_talloc_free, mem_ctx, |
40 |
NULL, NULL); |