$OpenBSD: patch-src_ircd_c,v 1.12 2016/07/03 06:22:38 ajacoutot Exp $
--- src/ircd.c.orig	Wed Jun 22 13:16:24 2016
+++ src/ircd.c	Sat Jul  2 18:59:13 2016
@@ -338,7 +338,6 @@ make_daemon(void)
   }
   else if (pid > 0)
   {
-    print_startup(pid);
     exit(EXIT_SUCCESS);
   }
 
@@ -351,8 +350,19 @@ main(int argc, char *argv[])
   /* Check to see if the user is running us as root, which is a nono */
   if (!geteuid())
   {
-    fprintf(stderr, "ERROR: This server won't run as root/superuser\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, "ERROR: This server won't run as root/superuser\n");
+      return -1;
+    }
   }
 
   /* Setup corefile size immediately after boot -kre */
