diff srogue/mdport.c @ 175:10c273a62228

srogue: remove md_droppriv() and md_resetpriv(). These partial privilege-dropping functions are no longer needed.
author John "Elwin" Edwards
date Sat, 01 Aug 2015 16:31:03 -0400
parents 600873555ec0
children f4f6734771e0
line wrap: on
line diff
--- a/srogue/mdport.c	Sat Aug 01 16:23:24 2015 -0400
+++ b/srogue/mdport.c	Sat Aug 01 16:31:03 2015 -0400
@@ -1533,41 +1533,6 @@
 #endif
 }
 
-void
-md_droppriv(void)
-{
-#if defined(HAVE_GETUID)
-	uid_t realuid = getuid();
-
-#if defined(HAVE_SETRESUID)
-    if (setresuid(-1, realuid, realuid) != 0) {
-#elif defined (HAVE_SETREUID) 
-    if (setreuid(realuid, realuid) != 0) {
-#elif defined (HAVE_SETUID)
-    if (setuid(realuid) != 0) {
-#else
-    if (0) {
-#endif
-	printf("Cannot change to effective uid: %d\n", realuid);
-	exit(1);
-    }
-#endif
-}
-
-extern uid_t playuid;
-extern gid_t playgid;
-
-void
-md_resetpriv(void)
-{
-#if defined (HAVE_SETUID)
-	setuid(playuid);
-#endif
-#if defined (HAVE_SETGID)
-	setgid(playgid);
-#endif
-}
-
 int
 md_random(void)
 {