about summary refs log tree commit diff
path: root/Src/openssh_bsd_setres_id.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/openssh_bsd_setres_id.c')
-rw-r--r--Src/openssh_bsd_setres_id.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Src/openssh_bsd_setres_id.c b/Src/openssh_bsd_setres_id.c
index 217a6d074..26c7d3958 100644
--- a/Src/openssh_bsd_setres_id.c
+++ b/Src/openssh_bsd_setres_id.c
@@ -55,6 +55,16 @@
 #include <unistd.h>
 #include <string.h>
 
+#ifdef __NetBSD__
+/*
+ * On NetBSD, setreuid() does not reset the saved uid if the real uid
+ * is not modified. Better to use setuid() that resets all of real,
+ * effective and saved uids to the specified value. Same for setregid().
+ */
+#define BROKEN_SETREUID
+#define BROKEN_SETREGID
+#endif
+
 #if defined(ZSH_IMPLEMENT_SETRESGID) || defined(BROKEN_SETRESGID)
 int
 setresgid(gid_t rgid, gid_t egid, gid_t sgid)