aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_agi.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-22 16:19:53 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-22 16:19:53 +0000
commit78ce48e1200233e1e1bfb609683ab07856cf9231 (patch)
treee564f390dbde5d0e81bcba3fb91b379b7a2baecd /res/res_agi.c
parent19ab5f94b5c15c72739e2d1c5e0386a77f1a4acb (diff)
Use stat to determine whether the file exists or not. (issue #10038 reported by Mike Anikienko)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@71158 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_agi.c')
-rw-r--r--res/res_agi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index dc4bbd7f7..fee2e231c 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -242,7 +242,8 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int *
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 @@ static enum agi_result launch_script(char *script, char *argv[], int *fds, int *
}
/* 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;
}