openbsd-ports/telephony/asterisk/patches/patch-asterisk_c
jolan 53cc38430a - update to 1.2.12.1
- be careful not to pick up odbc/popt if they happened to be installed

from maintainer stuart henderson
2006-09-24 21:09:25 +00:00

31 lines
977 B
Plaintext

$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 ]");