[asterisk-commits] mnicholson: trunk r168014 - /trunk/main/logger.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 9 10:32:34 CST 2009


Author: mnicholson
Date: Fri Jan  9 10:32:34 2009
New Revision: 168014

URL: http://svn.digium.com/view/asterisk?view=rev&rev=168014
Log:
Use ast_safe_system() in logger.c instead of system()

(closes issue #14194)
Reported by: pabelanger

Modified:
    trunk/main/logger.c

Modified: trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/main/logger.c?view=diff&rev=168014&r1=168013&r2=168014
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Fri Jan  9 10:32:34 2009
@@ -74,6 +74,7 @@
 #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>
@@ -576,8 +577,8 @@
 		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);
 	}




More information about the asterisk-commits mailing list