From 3f5f96ac91f570a6aa8b73d20f406410d8a79ed4 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Nov 2014 20:53:59 +0100 Subject: event/ServerSocket: fix get_remote_uid() error value Must return -1 on error, not 0. 0 is root. --- src/event/ServerSocket.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3