util: skip incomplete ucred information in getpeersec()

This commit is contained in:
Lennart Poettering
2014-11-25 14:28:34 +01:00
parent dc18cefdc3
commit 62028d9c2b
+4
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;