diff --git a/ChangeLog b/ChangeLog index 5c617aec3..f5a8b66bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-05-11 Jun-ichi Takimoto + + * 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 * 50176 (with xpufx, tweaked): Completion/Linux/Command/_htop: 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 #include +#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)