]> granicus.if.org Git - sudo/commitdiff
Fix compilation on HP-UX
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 May 2010 00:10:21 +0000 (20:10 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 14 May 2010 00:10:21 +0000 (20:10 -0400)
src/sudo_edit.c

index 20b7fbd8f3ffc4da9752f7cd65e2e69ea323f0ce..1c961befb3336a2e0876e4e14559d656a77fcd91 100644 (file)
 
 #include "sudo.h"
 
+/*
+ * Emulate seteuid() via setresuid() or setreuid()
+ * Needed on HP-UX and perhaps others.
+ */
+#if defined(HAVE_SETRESUID)
+# define seteuid(u)    setresuid(-1, u, -1)
+# define setegid(g)    setresgid(-1, g, -1)
+#elif defined(HAVE_SETREUID)
+# define seteuid(u)    setreuid(-1, u)
+# define setegid(g)    setregid(-1, g)
+#endif
+
 extern struct user_details user_details;
 
 static void