blob: aa14f19c81b1c023ebb88b1579fb0e53f3071e34 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
From 19344efa78be23a02008be9da0991f54455c9f9e Mon Sep 17 00:00:00 2001
From: Nicholas Marriott <nicholas.marriott@gmail.com>
Date: Mon, 22 Aug 2022 08:20:49 +0100
Subject: [PATCH] Fix fallback implementaion of getpeereid, from Pino Toscano.
---
compat/getpeereid.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/compat/getpeereid.c b/compat/getpeereid.c
index c194e886..b79f420a 100644
--- a/compat/getpeereid.c
+++ b/compat/getpeereid.c
@@ -18,6 +18,7 @@
#include <sys/socket.h>
#include <stdio.h>
+#include <unistd.h>
#ifdef HAVE_UCRED_H
#include <ucred.h>
@@ -49,6 +50,8 @@ getpeereid(int s, uid_t *uid, gid_t *gid)
ucred_free(ucred);
return (0);
#else
- return (getuid());
+ *uid = geteuid();
+ *gid = getegid();
+ return (0);
#endif
}
--
2.35.1
|