summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-24 21:21:24 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-25 14:28:34 +0100
commit62028d9c2b72bdbcec71d5c9f33d9a3bf143c6e4 (patch)
tree98eaf8aeea4e34e387f544b5dd27c77809319e24
parentdc18cefdc3bdedddeddf05ede7d662ed15cde825 (diff)
util: skip incomplete ucred information in getpeersec()
-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 01660526e4..b1ba0ed857 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -6482,6 +6482,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;