From 34415bf0b60738b22099023af5cd2cd1d202bf80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20V=C3=B6gele?= Date: Wed, 30 Jun 2010 21:42:01 +0200 Subject: Make get_remote_uid() work on BSD I've attached a patch that will make file URIs work on operating systems that provide the getpeereid() function call to check the user ID of the peer connected to a UNIX domain socket. --- src/listen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 } -- cgit v1.2.3