$OpenBSD: patch-src_ircd_c,v 1.6 2014/05/08 14:36:49 brad Exp $
--- src/ircd.c.orig	Tue Feb 25 07:27:20 2014
+++ src/ircd.c	Fri Mar 28 16:56:14 2014
@@ -131,7 +131,6 @@ make_daemon(void)
   }
   else if (pid > 0)
   {
-    print_startup(pid);
     exit(EXIT_SUCCESS);
   }
 
@@ -464,8 +463,19 @@ main(int argc, char *argv[])
   /* Check to see if the user is running us as root, which is a nono */
   if (geteuid() == 0)
   {
-    fprintf(stderr, "Don't run ircd as root!!!\n");
-    return -1;
+    struct passwd *pw;
+
+    if ((pw = getpwnam(IRCD_USER)) == NULL)
+    {
+      fprintf(stderr, "Don't run ircd as root!!!\n");
+      return -1;
+    }
+
+    if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL) < 0)
+    {
+      fprintf(stderr, "Can't set user context to %s!\n", IRCD_USER);
+      return -1;
+    }
   }
 
   /* Setup corefile size immediately after boot -kre */
