summaryrefslogtreecommitdiff
path: root/Src/openssh_bsd_setres_id.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-05-14 23:32:33 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-05-14 23:32:33 +0200
commit2ae4a3989e1bd06c82d597418a46b25cb14d57ed (patch)
tree9cfc4bf449c34f9493e369910e94773d4cc88366 /Src/openssh_bsd_setres_id.c
parent43867f68c0b1279ec096ce5639e6ec3a2df8103f (diff)
parentd4d203488826181aa4eb360ce57de138417ba680 (diff)
downloadzsh-2ae4a3989e1bd06c82d597418a46b25cb14d57ed.tar.gz
zsh-2ae4a3989e1bd06c82d597418a46b25cb14d57ed.zip
Update upstream source from tag 'upstream/5.9'
Update to upstream version '5.9' with Debian dir 9ec0c75153d850f8dda83cca1a9ed3ff6200c14b
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)