1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-10 11:01:32 +01:00

50192: use set{u,g}id() for dropping privilege on NetBSD

This commit is contained in:
Jun-ichi Takimoto 2022-05-11 11:22:46 +09:00
parent eec9882d04
commit c190883a0a
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2022-05-11 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
* 50192: Src/openssh_bsd_setres_id.c: use set{u,g}id() instead of
setre{u,g}id() for dropping privilege on NetBSD
2022-05-08 dana <dana@dana.is>
* 50176 (with xpufx, tweaked): Completion/Linux/Command/_htop:

View file

@ -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)