aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-11-18 20:53:59 +0100
committerMax Kellermann <max@duempel.org>2014-11-18 20:53:59 +0100
commit3f5f96ac91f570a6aa8b73d20f406410d8a79ed4 (patch)
tree3f339cae541ce66a466e63943cac31937170ecb3
parent7e7b403043b55c2e1bb9227fce725ad87626ae97 (diff)
downloadmpd-3f5f96ac91f570a6aa8b73d20f406410d8a79ed4.tar.gz
mpd-3f5f96ac91f570a6aa8b73d20f406410d8a79ed4.tar.xz
mpd-3f5f96ac91f570a6aa8b73d20f406410d8a79ed4.zip
event/ServerSocket: fix get_remote_uid() error value
Must return -1 on error, not 0. 0 is root.
-rw-r--r--src/event/ServerSocket.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx
index 781d29181..361aba886 100644
--- a/src/event/ServerSocket.cxx
+++ b/src/event/ServerSocket.cxx
@@ -141,7 +141,7 @@ get_remote_uid(int fd)
socklen_t len = sizeof (cred);
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0)
- return 0;
+ return -1;
return cred.uid;
#else