[SSSD] [PATCH] UTIL: Ignore insufficient permission for some proc files
Lukas Slebodnik
lslebodn at redhat.com
Mon Mar 17 08:02:39 UTC 2014
ehlo,
Attached patch fixes problem with find-uid test on altlinux.
Alexey Shabalin reported this in another thread.
LS
-------------- next part --------------
>From a120f2c62afe94dade098c55dce1bf25b4022b25 Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Fri, 14 Mar 2014 17:59:52 +0100
Subject: [PATCH] UTIL: Ignore insufficient permission for some proc files
proc filesystem can be mount with option hidepid=1.
In this case, we do not have permisions for reading some files
/proc/$(pid)/status; just ignore them.
---
src/util/find_uid.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/util/find_uid.c b/src/util/find_uid.c
index d34a4abd2c2bb4965ff49b9a750f387519544b0e..95991ebf2b14ff27a6a3740bfa048b5cfc631e94 100644
--- a/src/util/find_uid.c
+++ b/src/util/find_uid.c
@@ -223,6 +223,9 @@ static errno_t get_active_uid_linux(hash_table_t *table, uid_t search_uid)
}
ret = get_uid_from_pid(pid, &uid);
+ if (ret == EPERM) {
+ continue;
+ }
if (ret != EOK) {
DEBUG(1, ("get_uid_from_pid failed.\n"));
goto done;
--
1.8.5.3
More information about the sssd-devel
mailing list