From b4d413f672dd02fe5b6758ae40c03e27a0967679 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Jul 26 2018 14:39:18 +0000 Subject: Fix "test-find-uid" and "find_uid-tests" tests Handle a "hidepid=1" mount option for procfs. One of the affects - this option makes impermissible non own pid subdirectories on /proc. Resolves: https://pagure.io/SSSD/sssd/issue/3789 --- diff --git a/src/util/find_uid.c b/src/util/find_uid.c index 535d826..c03647a 100644 --- a/src/util/find_uid.c +++ b/src/util/find_uid.c @@ -90,8 +90,15 @@ static errno_t get_uid_from_pid(const pid_t pid, uid_t *uid) path); return EOK; } + // case of hidepid=1 mount option for /proc + if (error == EPERM) { + DEBUG(SSSDBG_TRACE_LIBS, + "Proc file [%s] is not permissible, continuing.\n", + path); + return EOK; + } DEBUG(SSSDBG_CRIT_FAILURE, - "open failed [%d][%s].\n", error, strerror(error)); + "open failed [%s][%d][%s].\n", path, error, strerror(error)); return error; }