summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;