diff --git a/include/c.h b/include/c.h index a4504e3ba..354b59e29 100644 --- a/include/c.h +++ b/include/c.h @@ -340,16 +340,10 @@ static inline size_t get_hostname_max(void) static inline int drop_permissions(void) { - gid_t newgid = getgid(); - errno = 0; - /* drop supplementary groups */ - if (geteuid() == 0 && setgroups(1, &newgid) != 0) - goto fail; - /* drop GID */ - if (setgid(newgid) < 0) + if (setgid(getgid()) < 0) goto fail; /* drop UID */