$OpenBSD: patch-asterisk_c,v 1.10 2007/07/19 01:31:28 ian Exp $
--- asterisk.c.orig	Thu Jun 28 00:22:13 2007
+++ asterisk.c	Wed Jul 18 00:40:27 2007
@@ -454,7 +454,7 @@ int ast_safe_system(const char *s)
 		/* Close file descriptors and launch system command */
 		for (x = STDERR_FILENO + 1; x < 4096; x++)
 			close(x);
-		execl("/bin/sh", "/bin/sh", "-c", s, NULL);
+		execl("/bin/sh", "/bin/sh", "-c", s, (void*)NULL);
 		_exit(1);
 	} else if (pid > 0) {
 		for(;;) {
@@ -2046,7 +2046,7 @@ int main(int argc, char *argv[])
 	int num;
 	int is_child_of_nonroot=0;
 	char *buf;
-	char *runuser=NULL, *rungroup=NULL;
+	char *runuser = "_asterisk", *rungroup = "_asterisk";
 
 	/* Remember original args for restart */
 	if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) {
@@ -2174,6 +2174,8 @@ int main(int argc, char *argv[])
 			argv[x] = argv[0] + 10;
 		}
 	}
+
+	chdir("/");
 
 	if (option_console && !option_verbose) 
 		ast_verbose("[ Reading Master Configuration ]");
