summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-24 21:21:24 +0100
committerAnthony G. Basile <blueness@gentoo.org>2014-11-28 12:38:00 -0500
commite6511db5d5f01c7b94ee0fc4166682708a33e35f (patch)
tree77e133c96cc792df0859a45fbe6a0501a542fc6d /src
parent805a4489ec125e78ff380ef1be89f0dad1e2fe87 (diff)
util: skip incomplete ucred information in getpeersec()
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src')
-rw-r--r--src/shared/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 0a9696f424..dbb425b050 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1480,6 +1480,10 @@ int getpeercred(int fd, struct ucred *ucred) {
* to namespacing issues */
if (u.pid <= 0)
return -ENODATA;
+ if (u.uid == (uid_t) -1)
+ return -ENODATA;
+ if (u.gid == (gid_t) -1)
+ return -ENODATA;
*ucred = u;
return 0;