util: skip incomplete ucred information in getpeersec()

This commit is contained in:
Lennart Poettering 2014-11-24 21:21:24 +01:00
parent dc18cefdc3
commit 62028d9c2b

View file

@ -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;