--- res/res_agi.c 2005-12-05 20:35:50.000000000 -0600 +++ res/res_agi.c.mod 2005-12-05 19:20:16.000000000 -0600 @@ -232,6 +232,14 @@ snprintf(tmp, sizeof(tmp), "%s/%s", (char *)ast_config_AST_AGI_DIR, script); script = tmp; } + if (access(script, F_OK)) { + ast_log(LOG_WARNING, "Unable to execute %s: File does not exist\n", script); + return -1; + } + if (access(script, X_OK)) { + ast_log(LOG_WARNING, "Unable to execute %s: File is not executable\n", script); + return -1; + } if (pipe(toast)) { ast_log(LOG_WARNING, "Unable to create toast pipe: %s\n",strerror(errno)); return -1;