chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
util: skip incomplete ucred information in getpeersec()
[elogind.git]
/
src
/
shared
/
util.c
diff --git
a/src/shared/util.c
b/src/shared/util.c
index 01660526e4556578ee49f49adaa8bba7ec852225..b1ba0ed857b24090b7e57b733f999e68e38c1a53 100644
(file)
--- 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;