- if (setegid (sct->m_gid))
- bb_error_msg_and_die
- ("BusyBox binary has insufficient rights to set proper GID for applet!");
- } else
- setgid (rgid); /* no sgid -> drop */
-
- if (sct->m_mode & S_ISUID) {
- if (seteuid (sct->m_uid))
- bb_error_msg_and_die
- ("BusyBox binary has insufficient rights to set proper UID for applet!");
- } else
- setuid (ruid); /* no suid -> drop */
+ xsetgid(sct->m_gid);
+ } else xsetgid(rgid); /* no sgid -> drop */
+
+ if (sct->m_mode & S_ISUID) xsetuid(sct->m_uid);
+ else xsetuid(ruid); /* no suid -> drop */