ngroups = 0;
}
+#ifdef __APPLE__
+ if(setregid(gid, gid) != 0) {
+#else
if(setresgid(gid, gid, gid) != 0) {
+#endif /* __APPLE__ */
error("Cannot switch to user's %s group (gid: %u).", username, gid);
return -1;
}
+#ifdef __APPLE__
+ if(setreuid(uid, uid) != 0) {
+#else
if(setresuid(uid, uid, uid) != 0) {
+#endif /* __APPLE__ */
error("Cannot switch to user %s (uid: %u).", username, uid);
return -1;
}