-/*
- * privs.h - header for privileged operations
+/*
+ * privs.h - header for privileged operations
* Copyright (C) 1993 Thomas Koenig
*
* Redistribution and use in source and binary forms, with or without
#endif
uid_t real_uid, effective_uid;
-#ifndef MAIN
+#ifndef MAIN
extern
#endif
gid_t real_gid, effective_gid;
PRIV_START \
effective_uid = (a); \
effective_gid = (b); \
- if (setregid((gid_t)-1, effective_gid)<0) perr("cannot setregid"); \
- if (setreuid((uid_t)-1, effective_uid)<0) perr("cannot setreuid"); \
+ if (setegid(effective_gid)<0) perr("cannot setegid"); \
+ if (seteuid(effective_uid)<0) perr("cannot seteuid"); \
PRIV_END \
}
#endif