aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/listen.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/listen.c b/src/listen.c
index 98108d9da..d6cade855 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -407,7 +407,13 @@ static int get_remote_uid(int fd)
return cred.uid;
#else
- (void)fd;
+#ifdef HAVE_GETPEEREID
+ uid_t euid;
+ gid_t egid;
+
+ if (getpeereid(fd, &euid, &egid) == 0)
+ return euid;
+#endif
return -1;
#endif
}