diff xrogue/state.c @ 143:7faf4568c295

Advanced Rogue family: overhaul privilege handling. Advanced Rogue 5 and 7, and XRogue, now open the scorefile and logfile at startup and then drop any set[ug]id privileges if the savedir is not being used.
author John "Elwin" Edwards
date Sat, 16 May 2015 13:39:26 -0400
parents cc5148bdf345
children 708bb2dea17c
line wrap: on
line diff
--- a/xrogue/state.c	Tue May 12 21:39:39 2015 -0400
+++ b/xrogue/state.c	Sat May 16 13:39:26 2015 -0400
@@ -3356,3 +3356,12 @@
     crmode();                        /* Cbreak mode */
     noecho();                           /* Echo off */
 }
+
+int
+md_normaluser(void)
+{
+#ifndef _WIN32
+    setuid(getuid());
+    setgid(getgid());
+#endif
+}