/* Dropping uid/gid privileges of the current process permanently.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
setresuid. */
if (setresgid (gid, gid, gid) < 0)
return -1;
-#elif HAVE_SETREGID /* MacOS X, NetBSD, AIX, IRIX, Solaris, OSF/1, Cygwin */
+#elif HAVE_SETREGID /* Mac OS X, NetBSD, AIX, IRIX, Solaris, OSF/1, Cygwin */
if (setregid (gid, gid) < 0)
return -1;
#elif HAVE_SETEGID /* Solaris 2.4 */
is used seems to vary a lot." */
if (setresuid (uid, uid, uid) < 0)
return -1;
-#elif HAVE_SETREUID /* MacOS X, NetBSD, AIX, IRIX, Solaris, OSF/1, Cygwin */
+#elif HAVE_SETREUID /* Mac OS X, NetBSD, AIX, IRIX, Solaris, OSF/1, Cygwin */
if (setreuid (uid, uid) < 0)
return -1;
#elif HAVE_SETEUID /* Solaris 2.4 */
uid_t effective;
uid_t saved;
if (getresuid (&real, &effective, &saved) < 0
- || real != uid
- || effective != uid
- || saved != uid)
+ || real != uid
+ || effective != uid
+ || saved != uid)
abort ();
}
#else
gid_t effective;
gid_t saved;
if (getresgid (&real, &effective, &saved) < 0
- || real != gid
- || effective != gid
- || saved != gid)
+ || real != gid
+ || effective != gid
+ || saved != gid)
abort ();
}
#else