[asterisk-commits] file: trunk r71158 - /trunk/res/res_agi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 22 11:19:54 CDT 2007


Author: file
Date: Fri Jun 22 11:19:53 2007
New Revision: 71158

URL: http://svn.digium.com/view/asterisk?view=rev&rev=71158
Log:
Use stat to determine whether the file exists or not. (issue #10038 reported by Mike Anikienko)

Modified:
    trunk/res/res_agi.c

Modified: trunk/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_agi.c?view=diff&rev=71158&r1=71157&r2=71158
==============================================================================
--- trunk/res/res_agi.c (original)
+++ trunk/res/res_agi.c Fri Jun 22 11:19:53 2007
@@ -242,7 +242,8 @@
 	int x;
 	int res;
 	sigset_t signal_set, old_set;
-	
+	struct stat st;
+
 	if (!strncasecmp(script, "agi://", 6))
 		return launch_netscript(script, argv, fds, efd, opid);
 	
@@ -252,7 +253,7 @@
 	}
 
 	/* Before even trying let's see if the file actually exists */
-	if (!ast_fileexists(script, NULL, NULL)) {
+	if (stat(script, &st)) {
 		ast_log(LOG_WARNING, "Failed to execute '%s': File does not exist.\n", script);
 		return AGI_RESULT_NOTFOUND;
 	}




More information about the asterisk-commits mailing list