aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-09 16:41:36 +0000
committermnicholson <mnicholson@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-09 16:41:36 +0000
commitb59775a80be18595c4304bb86de76439ee18f83b (patch)
treeaba9e39ed567c91eae587328cb33d45e82d26c1b
parent767711d33972b61741b1cae685f87831eee93913 (diff)
Merged revisions 168014 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r168014 | mnicholson | 2009-01-09 10:32:34 -0600 (Fri, 09 Jan 2009) | 5 lines Use ast_safe_system() in logger.c instead of system() (closes issue #14194) Reported by: pabelanger ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@168016 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/logger.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/logger.c b/main/logger.c
index 2001bc86b..55da65f22 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -74,6 +74,7 @@ static int syslog_level_map[] = {
#include "asterisk/threadstorage.h"
#include "asterisk/strings.h"
#include "asterisk/pbx.h"
+#include "asterisk/app.h"
#if defined(__linux__) && !defined(__NR_gettid)
#include <asm/unistd.h>
@@ -527,8 +528,8 @@ static int rotate_file(const char *filename)
char buf[512];
pbx_builtin_setvar_helper(c, "filename", filename);
pbx_substitute_variables_helper(c, exec_after_rotate, buf, sizeof(buf));
- if (system(buf) < 0) {
- ast_log(LOG_WARNING, "system() failed for '%s': %s\n", buf, strerror(errno));
+ if (ast_safe_system(buf) != -1) {
+ ast_log(LOG_WARNING, "error executing '%s'\n", buf);
}
ast_channel_free(c);
}