|
|
e71654 |
# ./pullrev.sh 1842929 1842931
|
|
|
e71654 |
http://svn.apache.org/viewvc?view=revision&revision=1842929
|
|
|
e71654 |
http://svn.apache.org/viewvc?view=revision&revision=1842931
|
|
|
e71654 |
|
|
|
e71654 |
--- httpd-2.4.37/acinclude.m4.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/acinclude.m4
|
|
|
e71654 |
@@ -45,6 +45,7 @@
|
|
|
e71654 |
APACHE_SUBST(installbuilddir)
|
|
|
e71654 |
APACHE_SUBST(runtimedir)
|
|
|
e71654 |
APACHE_SUBST(proxycachedir)
|
|
|
e71654 |
+ APACHE_SUBST(statedir)
|
|
|
e71654 |
APACHE_SUBST(other_targets)
|
|
|
e71654 |
APACHE_SUBST(progname)
|
|
|
e71654 |
APACHE_SUBST(prefix)
|
|
|
e71654 |
@@ -663,6 +664,7 @@
|
|
|
e71654 |
APACHE_SUBST_EXPANDED_ARG(runtimedir)
|
|
|
e71654 |
APACHE_SUBST_EXPANDED_ARG(logfiledir)
|
|
|
e71654 |
APACHE_SUBST_EXPANDED_ARG(proxycachedir)
|
|
|
e71654 |
+ APACHE_SUBST_EXPANDED_ARG(statedir)
|
|
|
e71654 |
])
|
|
|
e71654 |
|
|
|
e71654 |
dnl
|
|
|
e71654 |
--- httpd-2.4.37/config.layout.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/config.layout
|
|
|
e71654 |
@@ -29,6 +29,7 @@
|
|
|
e71654 |
includedir: ${prefix}/include
|
|
|
e71654 |
localstatedir: ${prefix}
|
|
|
e71654 |
runtimedir: ${localstatedir}/logs
|
|
|
e71654 |
+ statedir: ${localstatedir}/state
|
|
|
e71654 |
logfiledir: ${localstatedir}/logs
|
|
|
e71654 |
proxycachedir: ${localstatedir}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -54,6 +55,7 @@
|
|
|
e71654 |
includedir: ${prefix}/include+
|
|
|
e71654 |
localstatedir: ${prefix}/var+
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
+ statedir: ${localstatedir}/state
|
|
|
e71654 |
logfiledir: ${localstatedir}/log
|
|
|
e71654 |
proxycachedir: ${localstatedir}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -78,6 +80,7 @@
|
|
|
e71654 |
includedir: /System/Library/Frameworks/Apache.framework/Versions/2.0/Headers
|
|
|
e71654 |
localstatedir: /var
|
|
|
e71654 |
runtimedir: ${prefix}/Logs
|
|
|
e71654 |
+ statedir: ${prefix}/State
|
|
|
e71654 |
logfiledir: ${prefix}/Logs
|
|
|
e71654 |
proxycachedir: ${prefix}/ProxyCache
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -102,6 +105,7 @@
|
|
|
e71654 |
includedir: ${prefix}/include+
|
|
|
e71654 |
localstatedir: /var
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
+ statedir: ${localstatedir}/state
|
|
|
e71654 |
logfiledir: ${localstatedir}/log+
|
|
|
e71654 |
proxycachedir: ${runtimedir}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -126,6 +130,7 @@
|
|
|
e71654 |
includedir: ${prefix}/include/apache
|
|
|
e71654 |
localstatedir: /var
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
+ statedir: ${localstatedir}/lib/httpd
|
|
|
e71654 |
logfiledir: ${localstatedir}/log/httpd
|
|
|
e71654 |
proxycachedir: ${localstatedir}/cache/httpd
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -151,6 +156,7 @@
|
|
|
e71654 |
includedir: ${prefix}/include/httpd
|
|
|
e71654 |
runtimedir: /run/httpd
|
|
|
e71654 |
logfiledir: ${localstatedir}/log/httpd
|
|
|
e71654 |
+ statedir: ${localstatedir}/lib/httpd
|
|
|
e71654 |
proxycachedir: ${localstatedir}/cache/httpd/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
|
|
|
e71654 |
@@ -175,6 +181,7 @@
|
|
|
e71654 |
localstatedir: /var${prefix}
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
logfiledir: ${localstatedir}/logs
|
|
|
e71654 |
+ statedir: ${localstatedir}/state
|
|
|
e71654 |
proxycachedir: ${localstatedir}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
|
|
|
e71654 |
@@ -197,6 +204,7 @@
|
|
|
e71654 |
cgidir: ${datadir}/cgi-bin
|
|
|
e71654 |
includedir: ${prefix}/include/apache
|
|
|
e71654 |
localstatedir: /var/lib/httpd
|
|
|
e71654 |
+ statedir: ${localstatedir}
|
|
|
e71654 |
runtimedir: /var/run
|
|
|
e71654 |
logfiledir: /var/log/httpd
|
|
|
e71654 |
proxycachedir: /var/cache/httpd
|
|
|
e71654 |
@@ -223,6 +231,7 @@
|
|
|
e71654 |
localstatedir: /var
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
logfiledir: ${localstatedir}/log/httpd
|
|
|
e71654 |
+ statedir: ${prefix}/state
|
|
|
e71654 |
proxycachedir: ${localstatedir}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
|
|
|
e71654 |
@@ -246,6 +255,7 @@
|
|
|
e71654 |
includedir: ${exec_prefix}/include
|
|
|
e71654 |
localstatedir: ${prefix}
|
|
|
e71654 |
runtimedir: /var/run
|
|
|
e71654 |
+ statedir: ${datadir}/state
|
|
|
e71654 |
logfiledir: ${datadir}/logs
|
|
|
e71654 |
proxycachedir: ${datadir}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -271,6 +281,7 @@
|
|
|
e71654 |
localstatedir: ${prefix}
|
|
|
e71654 |
runtimedir: ${prefix}/logs
|
|
|
e71654 |
logfiledir: ${prefix}/logs
|
|
|
e71654 |
+ statedir: ${prefix}/state
|
|
|
e71654 |
proxycachedir: ${prefix}/proxy
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
|
|
|
e71654 |
@@ -315,6 +326,7 @@
|
|
|
e71654 |
cgidir: ${prefix}/usr/lib/cgi-bin
|
|
|
e71654 |
includedir: ${exec_prefix}/include/apache2
|
|
|
e71654 |
localstatedir: ${prefix}/var/lock/apache2
|
|
|
e71654 |
+ statedir: ${prefix}/var/lib/apache2
|
|
|
e71654 |
runtimedir: ${prefix}/var/run/apache2
|
|
|
e71654 |
logfiledir: ${prefix}/var/log/apache2
|
|
|
e71654 |
proxycachedir: ${prefix}/var/cache/apache2/proxy
|
|
|
e71654 |
@@ -343,6 +355,7 @@
|
|
|
e71654 |
manualdir: ${datadir}/manual
|
|
|
e71654 |
cgidir: ${datadir}/cgi-bin
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
+ runtimedir: ${localstatedir}/lib/httpd
|
|
|
e71654 |
logfiledir: ${localstatedir}/log/httpd
|
|
|
e71654 |
proxycachedir: ${localstatedir}/cache/httpd/cache-root
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
@@ -366,6 +379,7 @@
|
|
|
e71654 |
manualdir: ${prefix}/manual
|
|
|
e71654 |
includedir: ${prefix}/include
|
|
|
e71654 |
localstatedir: /var/httpd
|
|
|
e71654 |
+ statedir: ${localstatedir}/state
|
|
|
e71654 |
runtimedir: ${localstatedir}/run
|
|
|
e71654 |
logfiledir: ${localstatedir}/logs
|
|
|
e71654 |
proxycachedir: ${localstatedir}/proxy
|
|
|
e71654 |
@@ -391,6 +405,7 @@
|
|
|
e71654 |
includedir: ${prefix}/include/httpd
|
|
|
e71654 |
localstatedir: /var
|
|
|
e71654 |
runtimedir: ${localstatedir}/run/httpd
|
|
|
e71654 |
+ statedir: ${localstatedir}/lib/httpd
|
|
|
e71654 |
logfiledir: ${localstatedir}/log/httpd
|
|
|
e71654 |
proxycachedir: ${localstatedir}/cache/httpd
|
|
|
e71654 |
</Layout>
|
|
|
e71654 |
--- httpd-2.4.37/configure.in.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/configure.in
|
|
|
e71654 |
@@ -41,7 +41,7 @@
|
|
|
e71654 |
AC_PREFIX_DEFAULT(/usr/local/apache2)
|
|
|
e71654 |
|
|
|
e71654 |
dnl Get the layout here, so we can pass the required variables to apr
|
|
|
e71654 |
-APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir])
|
|
|
e71654 |
+APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir statedir])
|
|
|
e71654 |
|
|
|
e71654 |
dnl reparse the configure arguments.
|
|
|
e71654 |
APR_PARSE_ARGUMENTS
|
|
|
e71654 |
--- httpd-2.4.37/include/ap_config_layout.h.in.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/include/ap_config_layout.h.in
|
|
|
e71654 |
@@ -60,5 +60,7 @@
|
|
|
e71654 |
#define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@"
|
|
|
e71654 |
#define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@"
|
|
|
e71654 |
#define DEFAULT_REL_PROXYCACHEDIR "@rel_proxycachedir@"
|
|
|
e71654 |
+#define DEFAULT_EXP_STATEDIR "@exp_statedir@"
|
|
|
e71654 |
+#define DEFAULT_REL_STATEDIR "@rel_statedir@"
|
|
|
e71654 |
|
|
|
e71654 |
#endif /* AP_CONFIG_LAYOUT_H */
|
|
|
e71654 |
--- httpd-2.4.37/include/http_config.h.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/include/http_config.h
|
|
|
e71654 |
@@ -757,6 +757,14 @@
|
|
|
e71654 |
*/
|
|
|
e71654 |
AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname);
|
|
|
e71654 |
|
|
|
e71654 |
+/**
|
|
|
e71654 |
+ * Compute the name of a persistent state file (e.g. a database or
|
|
|
e71654 |
+ * long-lived cache) relative to the appropriate state directory.
|
|
|
e71654 |
+ * Absolute paths are returned as-is. The state directory is
|
|
|
e71654 |
+ * configured via the DefaultStateDir directive or at build time.
|
|
|
e71654 |
+ */
|
|
|
e71654 |
+AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *fname);
|
|
|
e71654 |
+
|
|
|
e71654 |
/* Finally, the hook for dynamically loading modules in... */
|
|
|
e71654 |
|
|
|
e71654 |
/**
|
|
|
e71654 |
--- httpd-2.4.37/Makefile.in.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/Makefile.in
|
|
|
e71654 |
@@ -213,6 +213,7 @@
|
|
|
e71654 |
install-other:
|
|
|
e71654 |
@test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
|
|
|
e71654 |
@test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
|
|
|
e71654 |
+ @test -d $(DESTDIR)$(statedir) || $(MKINSTALLDIRS) $(DESTDIR)$(statedir)
|
|
|
e71654 |
@for ext in dll x; do \
|
|
|
e71654 |
file=apachecore.$$ext; \
|
|
|
e71654 |
if test -f $$file; then \
|
|
|
e71654 |
--- httpd-2.4.37/modules/dav/fs/mod_dav_fs.c.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/modules/dav/fs/mod_dav_fs.c
|
|
|
e71654 |
@@ -29,6 +29,10 @@
|
|
|
e71654 |
|
|
|
e71654 |
extern module AP_MODULE_DECLARE_DATA dav_fs_module;
|
|
|
e71654 |
|
|
|
e71654 |
+#ifndef DEFAULT_DAV_LOCKDB
|
|
|
e71654 |
+#define DEFAULT_DAV_LOCKDB "davlockdb"
|
|
|
e71654 |
+#endif
|
|
|
e71654 |
+
|
|
|
e71654 |
const char *dav_get_lockdb_path(const request_rec *r)
|
|
|
e71654 |
{
|
|
|
e71654 |
dav_fs_server_conf *conf;
|
|
|
e71654 |
@@ -39,7 +43,11 @@
|
|
|
e71654 |
|
|
|
e71654 |
static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s)
|
|
|
e71654 |
{
|
|
|
e71654 |
- return apr_pcalloc(p, sizeof(dav_fs_server_conf));
|
|
|
e71654 |
+ dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf));
|
|
|
e71654 |
+
|
|
|
e71654 |
+ conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB);
|
|
|
e71654 |
+
|
|
|
e71654 |
+ return conf;
|
|
|
e71654 |
}
|
|
|
e71654 |
|
|
|
e71654 |
static void *dav_fs_merge_server_config(apr_pool_t *p,
|
|
|
e71654 |
--- httpd-2.4.37/modules/md/mod_md_config.c.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/modules/md/mod_md_config.c
|
|
|
e71654 |
@@ -54,10 +54,14 @@
|
|
|
e71654 |
|
|
|
e71654 |
#define DEF_VAL (-1)
|
|
|
e71654 |
|
|
|
e71654 |
+#ifndef MD_DEFAULT_BASE_DIR
|
|
|
e71654 |
+#define MD_DEFAULT_BASE_DIR "state/md"
|
|
|
e71654 |
+#endif
|
|
|
e71654 |
+
|
|
|
e71654 |
/* Default settings for the global conf */
|
|
|
e71654 |
static md_mod_conf_t defmc = {
|
|
|
e71654 |
NULL,
|
|
|
e71654 |
- "md",
|
|
|
e71654 |
+ NULL,
|
|
|
e71654 |
NULL,
|
|
|
e71654 |
NULL,
|
|
|
e71654 |
80,
|
|
|
e71654 |
@@ -112,6 +116,7 @@
|
|
|
e71654 |
memcpy(mod_md_config, &defmc, sizeof(*mod_md_config));
|
|
|
e71654 |
mod_md_config->mds = apr_array_make(pool, 5, sizeof(const md_t *));
|
|
|
e71654 |
mod_md_config->unused_names = apr_array_make(pool, 5, sizeof(const md_t *));
|
|
|
e71654 |
+ mod_md_config->base_dir = ap_state_dir_relative(pool, MD_DEFAULT_BASE_DIR);
|
|
|
e71654 |
|
|
|
e71654 |
apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null);
|
|
|
e71654 |
}
|
|
|
e71654 |
--- httpd-2.4.37/server/core.c.r1842929+
|
|
|
e71654 |
+++ httpd-2.4.37/server/core.c
|
|
|
e71654 |
@@ -129,6 +129,8 @@
|
|
|
e71654 |
AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN;
|
|
|
e71654 |
AP_DECLARE_DATA int ap_config_generation = 0;
|
|
|
e71654 |
|
|
|
e71654 |
+static const char *core_state_dir;
|
|
|
e71654 |
+
|
|
|
e71654 |
static void *create_core_dir_config(apr_pool_t *a, char *dir)
|
|
|
e71654 |
{
|
|
|
e71654 |
core_dir_config *conf;
|
|
|
e71654 |
@@ -3104,6 +3106,24 @@
|
|
|
e71654 |
return NULL;
|
|
|
e71654 |
}
|
|
|
e71654 |
|
|
|
e71654 |
+static const char *set_state_dir(cmd_parms *cmd, void *dummy, const char *arg)
|
|
|
e71654 |
+{
|
|
|
e71654 |
+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
|
|
|
e71654 |
+
|
|
|
e71654 |
+ if (err != NULL) {
|
|
|
e71654 |
+ return err;
|
|
|
e71654 |
+ }
|
|
|
e71654 |
+
|
|
|
e71654 |
+ if ((apr_filepath_merge((char**)&core_state_dir, NULL,
|
|
|
e71654 |
+ ap_server_root_relative(cmd->temp_pool, arg),
|
|
|
e71654 |
+ APR_FILEPATH_TRUENAME, cmd->pool) != APR_SUCCESS)
|
|
|
e71654 |
+ || !ap_is_directory(cmd->temp_pool, core_state_dir)) {
|
|
|
e71654 |
+ return "DefaultStateDir must be a valid directory, absolute or relative to ServerRoot";
|
|
|
e71654 |
+ }
|
|
|
e71654 |
+
|
|
|
e71654 |
+ return NULL;
|
|
|
e71654 |
+}
|
|
|
e71654 |
+
|
|
|
e71654 |
static const char *set_timeout(cmd_parms *cmd, void *dummy, const char *arg)
|
|
|
e71654 |
{
|
|
|
e71654 |
const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_CONTEXT);
|
|
|
e71654 |
@@ -4398,6 +4418,8 @@
|
|
|
e71654 |
"Common directory of server-related files (logs, confs, etc.)"),
|
|
|
e71654 |
AP_INIT_TAKE1("DefaultRuntimeDir", set_runtime_dir, NULL, RSRC_CONF | EXEC_ON_READ,
|
|
|
e71654 |
"Common directory for run-time files (shared memory, locks, etc.)"),
|
|
|
e71654 |
+AP_INIT_TAKE1("DefaultStateDir", set_state_dir, NULL, RSRC_CONF | EXEC_ON_READ,
|
|
|
e71654 |
+ "Common directory for persistent state (databases, long-lived caches, etc.)"),
|
|
|
e71654 |
AP_INIT_TAKE1("ErrorLog", set_server_string_slot,
|
|
|
e71654 |
(void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF,
|
|
|
e71654 |
"The filename of the error log"),
|
|
|
e71654 |
@@ -5150,6 +5172,27 @@
|
|
|
e71654 |
}
|
|
|
e71654 |
}
|
|
|
e71654 |
|
|
|
e71654 |
+AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *file)
|
|
|
e71654 |
+{
|
|
|
e71654 |
+ char *newpath = NULL;
|
|
|
e71654 |
+ apr_status_t rv;
|
|
|
e71654 |
+ const char *state_dir;
|
|
|
e71654 |
+
|
|
|
e71654 |
+ state_dir = core_state_dir
|
|
|
e71654 |
+ ? core_state_dir
|
|
|
e71654 |
+ : ap_server_root_relative(p, DEFAULT_REL_STATEDIR);
|
|
|
e71654 |
+
|
|
|
e71654 |
+ rv = apr_filepath_merge(&newpath, state_dir, file, APR_FILEPATH_TRUENAME, p);
|
|
|
e71654 |
+ if (newpath && (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv)
|
|
|
e71654 |
+ || APR_STATUS_IS_ENOENT(rv)
|
|
|
e71654 |
+ || APR_STATUS_IS_ENOTDIR(rv))) {
|
|
|
e71654 |
+ return newpath;
|
|
|
e71654 |
+ }
|
|
|
e71654 |
+ else {
|
|
|
e71654 |
+ return NULL;
|
|
|
e71654 |
+ }
|
|
|
e71654 |
+}
|
|
|
e71654 |
+
|
|
|
e71654 |
static apr_random_t *rng = NULL;
|
|
|
e71654 |
#if APR_HAS_THREADS
|
|
|
e71654 |
static apr_thread_mutex_t *rng_mutex = NULL;
|