<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">--- include/config.h.orig
+++ include/config.h
@@ -1,6 +1,11 @@
 #ifndef INCLUDED_config_h
 #define INCLUDED_config_h
 
+/* users */
+#ifndef IRCD_USER
+#define IRCD_USER "ratbox"
+#endif
+
 /* Paths to various things.
  * IMPORTANT: if you alter the directories these files go to,
  *            you must create those paths yourself.
--- include/stdinc.h.orig
+++ include/stdinc.h
@@ -41,6 +41,8 @@
 #include &lt;string.h&gt;
 #include &lt;strings.h&gt;
 #include &lt;ctype.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;pwd.h&gt;
 
 #include &lt;time.h&gt;
 #include &lt;sys/time.h&gt;
--- src/rserv.c.orig
+++ src/rserv.c
@@ -350,8 +350,17 @@
 
 	if(geteuid() == 0)
 	{
-		printf("ratbox-services will not run as root\n");
-		return -1;
+		struct passwd *pw;
+
+		if ((pw = getpwnam(IRCD_USER)) == NULL) {
+			printf("ratbox-services will not run as root\n");
+			return -1;
+		}
+
+		if (seteuid(pw-&gt;pw_uid) &lt; 0) {
+			printf("Can's set effective user ID to %s\n", IRCD_USER);
+			return -1;
+		}
 	}
 
 	if(chdir(PREFIX))
</pre></body></html>