$OpenBSD: patch-asterisk_c,v 1.5 2006/09/24 21:09:26 jolan Exp $ --- asterisk.c.orig Mon Aug 21 17:34:26 2006 +++ asterisk.c Tue Sep 19 14:26:50 2006 @@ -448,7 +448,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(;;) { @@ -2010,7 +2010,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) { @@ -2138,6 +2138,8 @@ int main(int argc, char *argv[]) argv[x] = argv[0] + 10; } } + + chdir("/"); if (option_console && !option_verbose) ast_verbose("[ Reading Master Configuration ]");