summaryrefslogtreecommitdiff
path: root/Src/openssh_bsd_setres_id.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-05-14 23:32:19 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-05-14 23:32:19 +0200
commitd4d203488826181aa4eb360ce57de138417ba680 (patch)
tree5f2939130b24381b6d8b11eec7573732eb52317a /Src/openssh_bsd_setres_id.c
parent9529af723604dfe1c8152db11e1d216621c898d5 (diff)
parent73d317384c9225e46d66444f93b46f0fbe7084ef (diff)
downloadzsh-d4d203488826181aa4eb360ce57de138417ba680.tar.gz
zsh-d4d203488826181aa4eb360ce57de138417ba680.zip
New upstream version 5.9
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)