# Microsoft Developer Studio Project File - Name="InstallBin" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) External Target" 0x0106
!MESSAGE
# Begin Project
-# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
-# PROP Cmd_Line "NMAKE /f makefile.win INSTDIR="\Apache2" SHORT=D LONG=Debug _install"
+# PROP Cmd_Line "NMAKE /f makefile.win INSTDIR="\test\Apache2.0.33" SHORT=D LONG=Debug _install"
# PROP Rebuild_Opt ""
# PROP Target_File "\Apache2\bin\Apache.exe"
# PROP Bsc_Name ""
char *fspec;
fspec = ap_server_root_relative(cmd->pool, filename);
- if (!fspec || (rv = apr_stat(&tmp, fspec, APR_FINFO_TYPE,
- cmd->temp_pool)) != APR_SUCCESS) {
+ if (!fspec) {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server,
+ "ISAPI: Invalid module path %s, skipping", filename);
+ return NULL;
+ }
+ if ((rv = apr_stat(&tmp, fspec, APR_FINFO_TYPE,
+ cmd->temp_pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server,
- "ISAPI: unable to stat(%s), skipping", filename);
+ "ISAPI: unable to stat(%s), skipping", fspec);
return NULL;
}
if (tmp.filetype != APR_REG) {
ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, cmd->server,
- "ISAPI: %s isn't a regular file, skipping", filename);
+ "ISAPI: %s isn't a regular file, skipping", fspec);
return NULL;
}
rv = isapi_load(cmd->pool, sconf, NULL, fspec, &isa);
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rv, cmd->server,
- "ISAPI: unable to cache %s, skipping", filename);
+ "ISAPI: unable to cache %s, skipping", fspec);
return NULL;
}
fspec = ap_server_root_relative(cmd->pool, filename);
if (!fspec) {
- ap_log_error(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, cmd->server,
- "mod_file_cache: unable to find relative path for "
+ ap_log_error(APLOG_MARK, APLOG_WARNING, APR_EBADPATH, cmd->server,
+ "mod_file_cache: invalid file path "
"%s, skipping", filename);
+ return;
}
if ((rc = apr_stat(&tmp.finfo, fspec, APR_FINFO_MIN,
cmd->temp_pool)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
- "mod_file_cache: unable to stat(%s), skipping", filename);
+ "mod_file_cache: unable to stat(%s), skipping", fspec);
return;
}
if (tmp.finfo.filetype != APR_REG) {
#include "httpd.h"
#include "http_config.h"
+#include "apr_strings.h"
#include "mod_dav.h"
#include "repos.h"
const char *arg1)
{
dav_fs_server_conf *conf;
-
conf = ap_get_module_config(cmd->server->module_config,
&dav_fs_module);
conf->lockdb_path = ap_server_root_relative(cmd->pool, arg1);
+ if (!conf->lockdb_path) {
+ return apr_pstrcat(cmd->pool, "Invalid DAVLockDB path ",
+ arg1, NULL);
+ }
+
return NULL;
}
&cgi_module);
conf->logname = ap_server_root_relative(cmd->pool, arg);
+
+ if (!conf->logname) {
+ return apr_pstrcat(cmd->pool, "Invalid ScriptLog path ",
+ arg, NULL);
+ }
+
return NULL;
}
&cgid_module);
conf->logname = ap_server_root_relative(cmd->pool, arg);
+
+ if (!conf->logname) {
+ return apr_pstrcat(cmd->pool, "Invalid ScriptLog path ",
+ arg1, NULL);
+ }
return NULL;
}
&cgid_module);
conf->sockname = ap_server_root_relative(cmd->pool, arg);
+
+ if (!conf->sockname) {
+ return apr_pstrcat(cmd->pool, "Invalid Scriptsock path ",
+ arg, NULL);
+ }
+
return NULL;
}
types_confname = AP_TYPES_CONFIG_FILE;
types_confname = ap_server_root_relative(p, types_confname);
-
- if ((status = ap_pcfg_openfile(&f, ptemp, types_confname)) != APR_SUCCESS) {
+ if (!types_confname) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
+ "Invalid mime types config path %s",
+ ap_get_module_config(s->module_config, &mime_module));
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+ if ((status = ap_pcfg_openfile(&f, ptemp, types_confname))
+ != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, status, s,
- "could not open mime types config file %s.", types_confname);
+ "could not open mime types config file %s.",
+ types_confname);
return HTTP_INTERNAL_SERVER_ERROR;
}
}
else {
const char *fname = ap_server_root_relative(p, cls->fname);
- if ((status = apr_file_open(&cls->log_fd, fname, xfer_flags, xfer_perms, p))
- != APR_SUCCESS) {
+ if (!fname) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
+ "invalid transfer log path %s.", cls->fname);
+ exit(1);
+ }
+ if ((status = apr_file_open(&cls->log_fd, fname, xfer_flags,
+ xfer_perms, p)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, status, s,
"could not open transfer log file %s.", fname);
exit(1);
/* XXX This is as SLOW as can be, next step, we optimize
* and merge to whatever part of the found path was already
* canonicalized. After I finish eliminating os canonical.
+ * Better fail test for ap_server_root_relative needed here.
*/
- if (!doesc)
+ if (!doesc) {
found = ap_server_root_relative(r->pool, found);
- *status = p->redir_status;
-
+ }
+ if (found) {
+ *status = p->redir_status;
+ }
return found;
}
if ((error = ap_check_cmd_context(cmd, GLOBAL_ONLY)) != NULL)
return error;
- lockname = a1;
+ /* fixup the path, especially for rewritelock_remove() */
+ lockname = ap_server_root_relative(cmd->pool, a1);
+
+ if (!lockname) {
+ return apr_pstrcat(cmd->pool, "Invalid RewriteLock path ", a1);
+ }
return NULL;
}
return; /* virtual log shared w/ main server */
}
- fname = ap_server_root_relative(p, conf->rewritelogfile);
-
if (*conf->rewritelogfile == '|') {
if ((pl = ap_open_piped_log(p, conf->rewritelogfile+1)) == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, 0, s,
conf->rewritelogfp = ap_piped_log_write_fd(pl);
}
else if (*conf->rewritelogfile != '\0') {
- rc = apr_file_open(&conf->rewritelogfp, fname, rewritelog_flags, rewritelog_mode, p);
- if (rc != APR_SUCCESS) {
+ fname = ap_server_root_relative(p, conf->rewritelogfile);
+ if (!fname) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
+ "mod_rewrite: Invalid RewriteLog "
+ "path %s", conf->rewritelogfile);
+ exit(1);
+ }
+ if ((rc = apr_file_open(&conf->rewritelogfp, fname,
+ rewritelog_flags, rewritelog_mode, p))
+ != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rc, s,
"mod_rewrite: could not open RewriteLog "
"file %s", fname);
return;
}
- /* fixup the path, especially for rewritelock_remove() */
- lockname = ap_server_root_relative(p, lockname);
-
/* create the lockfile */
rc = apr_global_mutex_create(&rewrite_mapr_lock_acquire, lockname,
APR_LOCK_DEFAULT, p);
apr_dso_handle_t *modhandle;
apr_dso_handle_sym_t modsym;
module *modp;
- const char *szModuleFile=ap_server_root_relative(cmd->pool, filename);
+ const char *szModuleFile = ap_server_root_relative(cmd->pool, filename);
so_server_conf *sconf;
moduleinfo *modi;
moduleinfo *modie;
*/
*(ap_directive_t **)dummy = NULL;
- /* ap_server_root_relative returns NULL if the paths couldn't be
- * merged (one is corrupt - dollars to donuts it's the named module
- */
if (!szModuleFile) {
- return apr_pstrcat(cmd->pool, "Cannot parse module name ",
+ return apr_pstrcat(cmd->pool, "Invalid LoadModule path ",
filename, NULL);
}
file = ap_server_root_relative(cmd->pool, filename);
- /* ap_server_root_relative returns NULL if the paths couldn't be
- * merged (one is corrupt - dollars to donuts it's the named module
- */
if (!file) {
- return apr_pstrcat(cmd->pool, "Cannot parse file name ",
+ return apr_pstrcat(cmd->pool, "Invalid LoadFile path ",
filename, NULL);
}
#endif
magic_server_config_rec *conf = (magic_server_config_rec *)
ap_get_module_config(s->module_config, &mime_magic_module);
-
const char *fname = ap_server_root_relative(p, conf->magicfile);
- result = apr_file_open(&f, fname, APR_READ | APR_BUFFERED, APR_OS_DEFAULT, p);
- if (result != APR_SUCCESS) {
+
+ if (!fname) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
+ MODNAME ": Invalid magic file path %s", conf->magicfile);
+ return -1;
+ }
+ if ((result = apr_file_open(&f, fname, APR_READ | APR_BUFFERED,
+ APR_OS_DEFAULT, p) != APR_SUCCESS)) {
ap_log_error(APLOG_MARK, APLOG_ERR, result, s,
- MODNAME ": can't read magic file %s", fname);
+ MODNAME ": can't read magic file %s", fname);
return -1;
}
/* Copy path, strip (all except the last) trailing slashes */
/* (the trailing slash is needed for the dir component loop below) */
- path = dir = ap_pstrcat(p, path, "/", NULL);
+ path = dir = apr_pstrcat(p, path, "/", NULL);
for (n = strlen(path); n > 1 && path[n - 1] == '/' && path[n - 2] == '/'; --n)
path[n - 1] = '\0';
filename = apr_pstrndup(p, &ctx->buffer[re_result[2].rm_so], re_result[2].rm_eo - re_result[2].rm_so);
- str = ap_pstrcat(p, ap_escape_html(p, apr_pstrndup(p, ctx->buffer, re_result[2].rm_so)),
- "<a href=\"", ap_escape_uri(p, filename), "\">",
- ap_escape_html(p, filename), "</a>\n", NULL);
+ str = apr_pstrcat(p, ap_escape_html(p, apr_pstrndup(p, ctx->buffer, re_result[2].rm_so)),
+ "<a href=\"", ap_escape_uri(p, filename), "\">",
+ ap_escape_html(p, filename), "</a>\n", NULL);
}
else {
strcat(ctx->buffer, "\n"); /* re-append the newline */
/* Check valid types, rather than ignoring invalid types silently: */
if (strchr("AEI", xfer_type) == NULL)
- return ap_proxyerror(r, HTTP_BAD_REQUEST, ap_pstrcat(r->pool,
+ return ap_proxyerror(r, HTTP_BAD_REQUEST, apr_pstrcat(r->pool,
"ftp proxy supports only types 'a', 'i', or 'e': \"",
type_suffix, "\" is invalid.", NULL));
}
* This allows most args to be independent of server_root,
* so the server can be moved or mirrored with less pain.
*/
- const char *p;
+ const char *path;
int offset = (int)(long)cmd->info;
- p = ap_server_root_relative(cmd->pool, arg);
- *(const char **) ((char*)struct_ptr + offset) = p;
+ path = ap_server_root_relative(cmd->pool, arg);
+
+ if (!path) {
+ return apr_pstrcat(cmd->pool, "Invalid file path ",
+ arg, NULL);
+ }
+
+ *(const char **) ((char*)struct_ptr + offset) = path;
return NULL;
}
*/
confname = ap_server_root_relative(p, filename);
+ if (!confname) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT,
+ APR_EBADPATH, NULL, "Invalid config file path %s",
+ filename);
+ exit(1);
+ }
+
ap_process_resource_config(s, confname, conftree, p, ptemp);
process_command_config(s, ap_server_post_read_config, conftree,
bit = ETAG_INODE;
}
else {
- return ap_pstrcat(cmd->pool, "Unknown keyword '",
- token, "' for ", cmd->cmd->name,
- " directive", NULL);
+ return apr_pstrcat(cmd->pool, "Unknown keyword '",
+ token, "' for ", cmd->cmd->name,
+ " directive", NULL);
}
if (! valid) {
- return ap_pstrcat(cmd->pool, cmd->cmd->name, " keyword '",
- token, "' cannot be used with '+' or '-'",
- NULL);
+ return apr_pstrcat(cmd->pool, cmd->cmd->name, " keyword '",
+ token, "' cannot be used with '+' or '-'",
+ NULL);
}
if (action == '+') {
const char *name)
{
ap_directive_t *conftree = NULL;
+ const char* conffile = ap_server_root_relative(cmd->pool, name);
+
+ if (!conffile) {
+ return apr_pstrcat(cmd->pool, "Invalid Include path ",
+ name, NULL);
+ }
- ap_process_resource_config(cmd->server,
- ap_server_root_relative(cmd->pool, name),
+ ap_process_resource_config(cmd->server, conffile,
&conftree, cmd->pool, cmd->temp_pool);
*(ap_directive_t **)dummy = conftree;
return NULL;
#endif
else {
fname = ap_server_root_relative(p, s->error_fname);
- rc = apr_file_open(&s->error_log, fname,
- APR_APPEND | APR_READ | APR_WRITE | APR_CREATE,
- APR_OS_DEFAULT, p);
- if (rc != APR_SUCCESS) {
+ if (!fname) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP, APR_EBADPATH, NULL,
+ "%s: Invalid error log path %s.",
+ ap_server_argv0, s->error_fname);
+ exit(1);
+ }
+ if ((rc = apr_file_open(&s->error_log, fname,
+ APR_APPEND | APR_READ | APR_WRITE | APR_CREATE,
+ APR_OS_DEFAULT, p)) != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_STARTUP, rc, NULL,
"%s: could not open error log file %s.",
- ap_server_argv0, fname);
+ ap_server_argv0, s->error_fname);
exit(1);
}
va_end(args);
}
-AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *fname)
+AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *filename)
{
apr_file_t *pid_file = NULL;
apr_finfo_t finfo;
static pid_t saved_pid = -1;
pid_t mypid;
apr_status_t rv;
+ const char *fname;
- if (!fname)
- return;
+ if (!filename) {
+ return;
+ }
+
+ fname = ap_server_root_relative(p, filename);
+ if (!fname) {
+ ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, APR_EBADPATH,
+ NULL, "Invalid PID file path %s, ignoring.", filename);
+ return;
+ }
- fname = ap_server_root_relative(p, fname);
mypid = getpid();
if (mypid != saved_pid
&& apr_stat(&finfo, fname, APR_FINFO_MTIME, p) == APR_SUCCESS) {
const char *ap_mpm_set_coredumpdir(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ apr_status_t rv;
apr_finfo_t finfo;
const char *fname;
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
}
fname = ap_server_root_relative(cmd->pool, arg);
- if ((apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool) != APR_SUCCESS)
- || (finfo.filetype != APR_DIR)) {
+ if (!fname) {
+ return apr_pstrcat(cmd->pool, "Invalid CoreDumpDirectory path ",
+ arg, NULL);
+ }
+ if ((rv = apr_stat(&finfo, fname, APR_FINFO_TYPE, cmd->pool)) != APR_SUCCESS) {
return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
- " does not exist or is not a directory", NULL);
+ " does not exist", NULL);
+ }
+ if (finfo.filetype != APR_DIR) {
+ return apr_pstrcat(cmd->pool, "CoreDumpDirectory ", fname,
+ " is not a directory", NULL);
}
-
apr_cpystrn(ap_coredump_dir, fname, sizeof(ap_coredump_dir));
return NULL;
}
if (ap_scoreboard_fname) {
/* make sure it's an absolute pathname */
fname = ap_server_root_relative(pconf, ap_scoreboard_fname);
-
+ if (!fname) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EBADPATH, NULL,
+ "Fatal error: Invalid Scoreboard path %s",
+ ap_scoreboard_fname);
+ return APR_EBADPATH;
+ }
return create_namebased_scoreboard(global_pool, fname);
}
else { /* config didn't specify, we get to choose shmem type */