diff --git a/httpd-2.4.37-r1842929+.patch b/httpd-2.4.37-r1842929+.patch deleted file mode 100644 index e841e34..0000000 --- a/httpd-2.4.37-r1842929+.patch +++ /dev/null @@ -1,326 +0,0 @@ -# ./pullrev.sh 1842929 1842931 -http://svn.apache.org/viewvc?view=revision&revision=1842929 -http://svn.apache.org/viewvc?view=revision&revision=1842931 -http://svn.apache.org/viewvc?view=revision&revision=1852982 - ---- httpd-2.4.38/acinclude.m4.r1842929+ -+++ httpd-2.4.38/acinclude.m4 -@@ -45,6 +45,7 @@ - APACHE_SUBST(installbuilddir) - APACHE_SUBST(runtimedir) - APACHE_SUBST(proxycachedir) -+ APACHE_SUBST(statedir) - APACHE_SUBST(other_targets) - APACHE_SUBST(progname) - APACHE_SUBST(prefix) -@@ -663,6 +664,7 @@ - APACHE_SUBST_EXPANDED_ARG(runtimedir) - APACHE_SUBST_EXPANDED_ARG(logfiledir) - APACHE_SUBST_EXPANDED_ARG(proxycachedir) -+ APACHE_SUBST_EXPANDED_ARG(statedir) - ]) - - dnl ---- httpd-2.4.38/config.layout.r1842929+ -+++ httpd-2.4.38/config.layout -@@ -29,6 +29,7 @@ - includedir: ${prefix}/include - localstatedir: ${prefix} - runtimedir: ${localstatedir}/logs -+ statedir: ${localstatedir}/state - logfiledir: ${localstatedir}/logs - proxycachedir: ${localstatedir}/proxy - -@@ -54,6 +55,7 @@ - includedir: ${prefix}/include+ - localstatedir: ${prefix}/var+ - runtimedir: ${localstatedir}/run -+ statedir: ${localstatedir}/state - logfiledir: ${localstatedir}/log - proxycachedir: ${localstatedir}/proxy - -@@ -78,6 +80,7 @@ - includedir: /System/Library/Frameworks/Apache.framework/Versions/2.0/Headers - localstatedir: /var - runtimedir: ${prefix}/Logs -+ statedir: ${prefix}/State - logfiledir: ${prefix}/Logs - proxycachedir: ${prefix}/ProxyCache - -@@ -102,6 +105,7 @@ - includedir: ${prefix}/include+ - localstatedir: /var - runtimedir: ${localstatedir}/run -+ statedir: ${localstatedir}/state - logfiledir: ${localstatedir}/log+ - proxycachedir: ${runtimedir}/proxy - -@@ -126,6 +130,7 @@ - includedir: ${prefix}/include/apache - localstatedir: /var - runtimedir: ${localstatedir}/run -+ statedir: ${localstatedir}/lib/httpd - logfiledir: ${localstatedir}/log/httpd - proxycachedir: ${localstatedir}/cache/httpd - -@@ -151,6 +156,7 @@ - includedir: ${prefix}/include/httpd - runtimedir: /run/httpd - logfiledir: ${localstatedir}/log/httpd -+ statedir: ${localstatedir}/lib/httpd - proxycachedir: ${localstatedir}/cache/httpd/proxy - - -@@ -175,6 +181,7 @@ - localstatedir: /var${prefix} - runtimedir: ${localstatedir}/run - logfiledir: ${localstatedir}/logs -+ statedir: ${localstatedir}/state - proxycachedir: ${localstatedir}/proxy - - -@@ -197,6 +204,7 @@ - cgidir: ${datadir}/cgi-bin - includedir: ${prefix}/include/apache - localstatedir: /var/lib/httpd -+ statedir: ${localstatedir} - runtimedir: /var/run - logfiledir: /var/log/httpd - proxycachedir: /var/cache/httpd -@@ -223,6 +231,7 @@ - localstatedir: /var - runtimedir: ${localstatedir}/run - logfiledir: ${localstatedir}/log/httpd -+ statedir: ${prefix}/state - proxycachedir: ${localstatedir}/proxy - - -@@ -246,6 +255,7 @@ - includedir: ${exec_prefix}/include - localstatedir: ${prefix} - runtimedir: /var/run -+ statedir: ${datadir}/state - logfiledir: ${datadir}/logs - proxycachedir: ${datadir}/proxy - -@@ -271,6 +281,7 @@ - localstatedir: ${prefix} - runtimedir: ${prefix}/logs - logfiledir: ${prefix}/logs -+ statedir: ${prefix}/state - proxycachedir: ${prefix}/proxy - - -@@ -315,6 +326,7 @@ - cgidir: ${prefix}/usr/lib/cgi-bin - includedir: ${exec_prefix}/include/apache2 - localstatedir: ${prefix}/var/lock/apache2 -+ statedir: ${prefix}/var/lib/apache2 - runtimedir: ${prefix}/var/run/apache2 - logfiledir: ${prefix}/var/log/apache2 - proxycachedir: ${prefix}/var/cache/apache2/proxy -@@ -343,6 +355,7 @@ - manualdir: ${datadir}/manual - cgidir: ${datadir}/cgi-bin - runtimedir: ${localstatedir}/run -+ runtimedir: ${localstatedir}/lib/httpd - logfiledir: ${localstatedir}/log/httpd - proxycachedir: ${localstatedir}/cache/httpd/cache-root - -@@ -366,6 +379,7 @@ - manualdir: ${prefix}/manual - includedir: ${prefix}/include - localstatedir: /var/httpd -+ statedir: ${localstatedir}/state - runtimedir: ${localstatedir}/run - logfiledir: ${localstatedir}/logs - proxycachedir: ${localstatedir}/proxy -@@ -391,6 +405,7 @@ - includedir: ${prefix}/include/httpd - localstatedir: /var - runtimedir: ${localstatedir}/run/httpd -+ statedir: ${localstatedir}/lib/httpd - logfiledir: ${localstatedir}/log/httpd - proxycachedir: ${localstatedir}/cache/httpd - ---- httpd-2.4.38/configure.in.r1842929+ -+++ httpd-2.4.38/configure.in -@@ -41,7 +41,7 @@ - AC_PREFIX_DEFAULT(/usr/local/apache2) - - dnl Get the layout here, so we can pass the required variables to apr --APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir]) -+APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir statedir]) - - dnl reparse the configure arguments. - APR_PARSE_ARGUMENTS ---- httpd-2.4.38/include/ap_config_layout.h.in.r1842929+ -+++ httpd-2.4.38/include/ap_config_layout.h.in -@@ -60,5 +60,7 @@ - #define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@" - #define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@" - #define DEFAULT_REL_PROXYCACHEDIR "@rel_proxycachedir@" -+#define DEFAULT_EXP_STATEDIR "@exp_statedir@" -+#define DEFAULT_REL_STATEDIR "@rel_statedir@" - - #endif /* AP_CONFIG_LAYOUT_H */ ---- httpd-2.4.38/include/http_config.h.r1842929+ -+++ httpd-2.4.38/include/http_config.h -@@ -757,6 +757,14 @@ - */ - AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname); - -+/** -+ * Compute the name of a persistent state file (e.g. a database or -+ * long-lived cache) relative to the appropriate state directory. -+ * Absolute paths are returned as-is. The state directory is -+ * configured via the DefaultStateDir directive or at build time. -+ */ -+AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *fname); -+ - /* Finally, the hook for dynamically loading modules in... */ - - /** ---- httpd-2.4.38/Makefile.in.r1842929+ -+++ httpd-2.4.38/Makefile.in -@@ -213,6 +213,7 @@ - install-other: - @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir) - @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir) -+ @test -d $(DESTDIR)$(statedir) || $(MKINSTALLDIRS) $(DESTDIR)$(statedir) - @for ext in dll x; do \ - file=apachecore.$$ext; \ - if test -f $$file; then \ ---- httpd-2.4.38/modules/dav/fs/mod_dav_fs.c.r1842929+ -+++ httpd-2.4.38/modules/dav/fs/mod_dav_fs.c -@@ -29,6 +29,10 @@ - - extern module AP_MODULE_DECLARE_DATA dav_fs_module; - -+#ifndef DEFAULT_DAV_LOCKDB -+#define DEFAULT_DAV_LOCKDB "davlockdb" -+#endif -+ - const char *dav_get_lockdb_path(const request_rec *r) - { - dav_fs_server_conf *conf; -@@ -39,7 +43,11 @@ - - static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s) - { -- return apr_pcalloc(p, sizeof(dav_fs_server_conf)); -+ dav_fs_server_conf *conf = apr_pcalloc(p, sizeof(dav_fs_server_conf)); -+ -+ conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB); -+ -+ return conf; - } - - static void *dav_fs_merge_server_config(apr_pool_t *p, ---- httpd-2.4.38/modules/md/mod_md_config.c.r1842929+ -+++ httpd-2.4.38/modules/md/mod_md_config.c -@@ -54,10 +54,14 @@ - - #define DEF_VAL (-1) - -+#ifndef MD_DEFAULT_BASE_DIR -+#define MD_DEFAULT_BASE_DIR "md" -+#endif -+ - /* Default settings for the global conf */ - static md_mod_conf_t defmc = { - NULL, -- "md", -+ NULL, - NULL, - NULL, - 80, -@@ -112,6 +116,7 @@ - memcpy(mod_md_config, &defmc, sizeof(*mod_md_config)); - mod_md_config->mds = apr_array_make(pool, 5, sizeof(const md_t *)); - mod_md_config->unused_names = apr_array_make(pool, 5, sizeof(const md_t *)); -+ mod_md_config->base_dir = ap_state_dir_relative(pool, MD_DEFAULT_BASE_DIR); - - apr_pool_cleanup_register(pool, NULL, cleanup_mod_config, apr_pool_cleanup_null); - } ---- httpd-2.4.38/server/core.c.r1842929+ -+++ httpd-2.4.38/server/core.c -@@ -129,6 +129,8 @@ - AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN; - AP_DECLARE_DATA int ap_config_generation = 0; - -+static const char *core_state_dir; -+ - static void *create_core_dir_config(apr_pool_t *a, char *dir) - { - core_dir_config *conf; -@@ -3104,6 +3106,24 @@ - return NULL; - } - -+static const char *set_state_dir(cmd_parms *cmd, void *dummy, const char *arg) -+{ -+ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); -+ -+ if (err != NULL) { -+ return err; -+ } -+ -+ if ((apr_filepath_merge((char**)&core_state_dir, NULL, -+ ap_server_root_relative(cmd->temp_pool, arg), -+ APR_FILEPATH_TRUENAME, cmd->pool) != APR_SUCCESS) -+ || !ap_is_directory(cmd->temp_pool, core_state_dir)) { -+ return "DefaultStateDir must be a valid directory, absolute or relative to ServerRoot"; -+ } -+ -+ return NULL; -+} -+ - static const char *set_timeout(cmd_parms *cmd, void *dummy, const char *arg) - { - const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_CONTEXT); -@@ -4398,6 +4418,8 @@ - "Common directory of server-related files (logs, confs, etc.)"), - AP_INIT_TAKE1("DefaultRuntimeDir", set_runtime_dir, NULL, RSRC_CONF | EXEC_ON_READ, - "Common directory for run-time files (shared memory, locks, etc.)"), -+AP_INIT_TAKE1("DefaultStateDir", set_state_dir, NULL, RSRC_CONF | EXEC_ON_READ, -+ "Common directory for persistent state (databases, long-lived caches, etc.)"), - AP_INIT_TAKE1("ErrorLog", set_server_string_slot, - (void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF, - "The filename of the error log"), -@@ -4927,6 +4949,7 @@ - ap_regcomp_set_default_cflags(AP_REG_DOLLAR_ENDONLY); - - mpm_common_pre_config(pconf); -+ core_state_dir = NULL; - - return OK; - } -@@ -5150,6 +5173,27 @@ - } - } - -+AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *file) -+{ -+ char *newpath = NULL; -+ apr_status_t rv; -+ const char *state_dir; -+ -+ state_dir = core_state_dir -+ ? core_state_dir -+ : ap_server_root_relative(p, DEFAULT_REL_STATEDIR); -+ -+ rv = apr_filepath_merge(&newpath, state_dir, file, APR_FILEPATH_TRUENAME, p); -+ if (newpath && (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv) -+ || APR_STATUS_IS_ENOENT(rv) -+ || APR_STATUS_IS_ENOTDIR(rv))) { -+ return newpath; -+ } -+ else { -+ return NULL; -+ } -+} -+ - static apr_random_t *rng = NULL; - #if APR_HAS_THREADS - static apr_thread_mutex_t *rng_mutex = NULL; diff --git a/httpd-2.4.39-r1842929+.patch b/httpd-2.4.39-r1842929+.patch new file mode 100644 index 0000000..50f8aa1 --- /dev/null +++ b/httpd-2.4.39-r1842929+.patch @@ -0,0 +1,378 @@ +# ./pullrev.sh 1842929 1842931 1852982 1853631 1857731 +http://svn.apache.org/viewvc?view=revision&revision=1842929 +http://svn.apache.org/viewvc?view=revision&revision=1842931 +http://svn.apache.org/viewvc?view=revision&revision=1852982 +http://svn.apache.org/viewvc?view=revision&revision=1857731 +http://svn.apache.org/viewvc?view=revision&revision=1853631 + +--- httpd-2.4.39/acinclude.m4.r1842929+ ++++ httpd-2.4.39/acinclude.m4 +@@ -45,6 +45,7 @@ + APACHE_SUBST(installbuilddir) + APACHE_SUBST(runtimedir) + APACHE_SUBST(proxycachedir) ++ APACHE_SUBST(statedir) + APACHE_SUBST(other_targets) + APACHE_SUBST(progname) + APACHE_SUBST(prefix) +@@ -663,6 +664,7 @@ + APACHE_SUBST_EXPANDED_ARG(runtimedir) + APACHE_SUBST_EXPANDED_ARG(logfiledir) + APACHE_SUBST_EXPANDED_ARG(proxycachedir) ++ APACHE_SUBST_EXPANDED_ARG(statedir) + ]) + + dnl +--- httpd-2.4.39/config.layout.r1842929+ ++++ httpd-2.4.39/config.layout +@@ -29,6 +29,7 @@ + includedir: ${prefix}/include + localstatedir: ${prefix} + runtimedir: ${localstatedir}/logs ++ statedir: ${localstatedir}/state + logfiledir: ${localstatedir}/logs + proxycachedir: ${localstatedir}/proxy + +@@ -54,6 +55,7 @@ + includedir: ${prefix}/include+ + localstatedir: ${prefix}/var+ + runtimedir: ${localstatedir}/run ++ statedir: ${localstatedir}/state + logfiledir: ${localstatedir}/log + proxycachedir: ${localstatedir}/proxy + +@@ -78,6 +80,7 @@ + includedir: /System/Library/Frameworks/Apache.framework/Versions/2.0/Headers + localstatedir: /var + runtimedir: ${prefix}/Logs ++ statedir: ${prefix}/State + logfiledir: ${prefix}/Logs + proxycachedir: ${prefix}/ProxyCache + +@@ -102,6 +105,7 @@ + includedir: ${prefix}/include+ + localstatedir: /var + runtimedir: ${localstatedir}/run ++ statedir: ${localstatedir}/state + logfiledir: ${localstatedir}/log+ + proxycachedir: ${runtimedir}/proxy + +@@ -126,6 +130,7 @@ + includedir: ${prefix}/include/apache + localstatedir: /var + runtimedir: ${localstatedir}/run ++ statedir: ${localstatedir}/lib/httpd + logfiledir: ${localstatedir}/log/httpd + proxycachedir: ${localstatedir}/cache/httpd + +@@ -151,6 +156,7 @@ + includedir: ${prefix}/include/httpd + runtimedir: /run/httpd + logfiledir: ${localstatedir}/log/httpd ++ statedir: ${localstatedir}/lib/httpd + proxycachedir: ${localstatedir}/cache/httpd/proxy + + +@@ -175,6 +181,7 @@ + localstatedir: /var${prefix} + runtimedir: ${localstatedir}/run + logfiledir: ${localstatedir}/logs ++ statedir: ${localstatedir}/state + proxycachedir: ${localstatedir}/proxy + + +@@ -197,6 +204,7 @@ + cgidir: ${datadir}/cgi-bin + includedir: ${prefix}/include/apache + localstatedir: /var/lib/httpd ++ statedir: ${localstatedir} + runtimedir: /var/run + logfiledir: /var/log/httpd + proxycachedir: /var/cache/httpd +@@ -223,6 +231,7 @@ + localstatedir: /var + runtimedir: ${localstatedir}/run + logfiledir: ${localstatedir}/log/httpd ++ statedir: ${prefix}/state + proxycachedir: ${localstatedir}/proxy + + +@@ -246,6 +255,7 @@ + includedir: ${exec_prefix}/include + localstatedir: ${prefix} + runtimedir: /var/run ++ statedir: ${datadir}/state + logfiledir: ${datadir}/logs + proxycachedir: ${datadir}/proxy + +@@ -271,6 +281,7 @@ + localstatedir: ${prefix} + runtimedir: ${prefix}/logs + logfiledir: ${prefix}/logs ++ statedir: ${prefix}/state + proxycachedir: ${prefix}/proxy + + +@@ -315,6 +326,7 @@ + cgidir: ${prefix}/usr/lib/cgi-bin + includedir: ${exec_prefix}/include/apache2 + localstatedir: ${prefix}/var/lock/apache2 ++ statedir: ${prefix}/var/lib/apache2 + runtimedir: ${prefix}/var/run/apache2 + logfiledir: ${prefix}/var/log/apache2 + proxycachedir: ${prefix}/var/cache/apache2/proxy +@@ -343,6 +355,7 @@ + manualdir: ${datadir}/manual + cgidir: ${datadir}/cgi-bin + runtimedir: ${localstatedir}/run ++ runtimedir: ${localstatedir}/lib/httpd + logfiledir: ${localstatedir}/log/httpd + proxycachedir: ${localstatedir}/cache/httpd/cache-root + +@@ -366,6 +379,7 @@ + manualdir: ${prefix}/manual + includedir: ${prefix}/include + localstatedir: /var/httpd ++ statedir: ${localstatedir}/state + runtimedir: ${localstatedir}/run + logfiledir: ${localstatedir}/logs + proxycachedir: ${localstatedir}/proxy +@@ -391,6 +405,7 @@ + includedir: ${prefix}/include/httpd + localstatedir: /var + runtimedir: ${localstatedir}/run/httpd ++ statedir: ${localstatedir}/lib/httpd + logfiledir: ${localstatedir}/log/httpd + proxycachedir: ${localstatedir}/cache/httpd + +--- httpd-2.4.39/configure.in.r1842929+ ++++ httpd-2.4.39/configure.in +@@ -41,7 +41,7 @@ + AC_PREFIX_DEFAULT(/usr/local/apache2) + + dnl Get the layout here, so we can pass the required variables to apr +-APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir]) ++APR_ENABLE_LAYOUT(Apache, [errordir iconsdir htdocsdir cgidir statedir]) + + dnl reparse the configure arguments. + APR_PARSE_ARGUMENTS +--- httpd-2.4.39/include/ap_config_layout.h.in.r1842929+ ++++ httpd-2.4.39/include/ap_config_layout.h.in +@@ -60,5 +60,7 @@ + #define DEFAULT_REL_LOGFILEDIR "@rel_logfiledir@" + #define DEFAULT_EXP_PROXYCACHEDIR "@exp_proxycachedir@" + #define DEFAULT_REL_PROXYCACHEDIR "@rel_proxycachedir@" ++#define DEFAULT_EXP_STATEDIR "@exp_statedir@" ++#define DEFAULT_REL_STATEDIR "@rel_statedir@" + + #endif /* AP_CONFIG_LAYOUT_H */ +--- httpd-2.4.39/include/http_config.h.r1842929+ ++++ httpd-2.4.39/include/http_config.h +@@ -757,6 +757,14 @@ + */ + AP_DECLARE(char *) ap_runtime_dir_relative(apr_pool_t *p, const char *fname); + ++/** ++ * Compute the name of a persistent state file (e.g. a database or ++ * long-lived cache) relative to the appropriate state directory. ++ * Absolute paths are returned as-is. The state directory is ++ * configured via the DefaultStateDir directive or at build time. ++ */ ++AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *fname); ++ + /* Finally, the hook for dynamically loading modules in... */ + + /** +--- httpd-2.4.39/Makefile.in.r1842929+ ++++ httpd-2.4.39/Makefile.in +@@ -213,6 +213,7 @@ + install-other: + @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir) + @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir) ++ @test -d $(DESTDIR)$(statedir) || $(MKINSTALLDIRS) $(DESTDIR)$(statedir) + @for ext in dll x; do \ + file=apachecore.$$ext; \ + if test -f $$file; then \ +--- httpd-2.4.39/modules/dav/fs/mod_dav_fs.c.r1842929+ ++++ httpd-2.4.39/modules/dav/fs/mod_dav_fs.c +@@ -29,6 +29,10 @@ + + extern module AP_MODULE_DECLARE_DATA dav_fs_module; + ++#ifndef DEFAULT_DAV_LOCKDB ++#define DEFAULT_DAV_LOCKDB "davlockdb" ++#endif ++ + const char *dav_get_lockdb_path(const request_rec *r) + { + dav_fs_server_conf *conf; +@@ -57,6 +61,24 @@ + return newconf; + } + ++static apr_status_t dav_fs_post_config(apr_pool_t *p, apr_pool_t *plog, ++ apr_pool_t *ptemp, server_rec *base_server) ++{ ++ server_rec *s; ++ ++ for (s = base_server; s; s = s->next) { ++ dav_fs_server_conf *conf; ++ ++ conf = ap_get_module_config(s->module_config, &dav_fs_module); ++ ++ if (!conf->lockdb_path) { ++ conf->lockdb_path = ap_state_dir_relative(p, DEFAULT_DAV_LOCKDB); ++ } ++ } ++ ++ return OK; ++} ++ + /* + * Command handler for the DAVLockDB directive, which is TAKE1 + */ +@@ -87,6 +109,8 @@ + + static void register_hooks(apr_pool_t *p) + { ++ ap_hook_post_config(dav_fs_post_config, NULL, NULL, APR_HOOK_MIDDLE); ++ + dav_hook_gather_propsets(dav_fs_gather_propsets, NULL, NULL, + APR_HOOK_MIDDLE); + dav_hook_find_liveprop(dav_fs_find_liveprop, NULL, NULL, APR_HOOK_MIDDLE); +--- httpd-2.4.39/modules/md/mod_md_config.c.r1842929+ ++++ httpd-2.4.39/modules/md/mod_md_config.c +@@ -54,10 +54,18 @@ + + #define DEF_VAL (-1) + ++#ifndef MD_DEFAULT_BASE_DIR ++#define MD_DEFAULT_BASE_DIR "md" ++#endif ++ + /* Default settings for the global conf */ + static md_mod_conf_t defmc = { + NULL, +- "md", ++#if 1 ++ NULL, /* apply default state-dir-relative */ ++#else ++ MD_DEFAULT_BASE_DIR, ++#endif + NULL, + NULL, + 80, +@@ -864,6 +872,12 @@ + if (mc->hsts_max_age > 0) { + mc->hsts_header = apr_psprintf(p, "max-age=%d", mc->hsts_max_age); + } ++ ++#if 1 ++ if (mc->base_dir == NULL) { ++ mc->base_dir = ap_state_dir_relative(p, MD_DEFAULT_BASE_DIR); ++ } ++#endif + + return APR_SUCCESS; + } +--- httpd-2.4.39/server/core.c.r1842929+ ++++ httpd-2.4.39/server/core.c +@@ -129,6 +129,8 @@ + AP_DECLARE_DATA int ap_run_mode = AP_SQ_RM_UNKNOWN; + AP_DECLARE_DATA int ap_config_generation = 0; + ++static const char *core_state_dir; ++ + static void *create_core_dir_config(apr_pool_t *a, char *dir) + { + core_dir_config *conf; +@@ -1409,12 +1411,15 @@ + return res_buf; + } + +-static int reset_config_defines(void *dummy) ++/* pconf cleanup - clear global variables set from config here. */ ++static apr_status_t reset_config(void *dummy) + { + ap_server_config_defines = saved_server_config_defines; + saved_server_config_defines = NULL; + server_config_defined_vars = NULL; +- return OK; ++ core_state_dir = NULL; ++ ++ return APR_SUCCESS; + } + + /* +@@ -3113,6 +3118,24 @@ + return NULL; + } + ++static const char *set_state_dir(cmd_parms *cmd, void *dummy, const char *arg) ++{ ++ const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); ++ ++ if (err != NULL) { ++ return err; ++ } ++ ++ if ((apr_filepath_merge((char**)&core_state_dir, NULL, ++ ap_server_root_relative(cmd->temp_pool, arg), ++ APR_FILEPATH_TRUENAME, cmd->pool) != APR_SUCCESS) ++ || !ap_is_directory(cmd->temp_pool, core_state_dir)) { ++ return "DefaultStateDir must be a valid directory, absolute or relative to ServerRoot"; ++ } ++ ++ return NULL; ++} ++ + static const char *set_timeout(cmd_parms *cmd, void *dummy, const char *arg) + { + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_CONTEXT); +@@ -4407,6 +4430,8 @@ + "Common directory of server-related files (logs, confs, etc.)"), + AP_INIT_TAKE1("DefaultRuntimeDir", set_runtime_dir, NULL, RSRC_CONF | EXEC_ON_READ, + "Common directory for run-time files (shared memory, locks, etc.)"), ++AP_INIT_TAKE1("DefaultStateDir", set_state_dir, NULL, RSRC_CONF | EXEC_ON_READ, ++ "Common directory for persistent state (databases, long-lived caches, etc.)"), + AP_INIT_TAKE1("ErrorLog", set_server_string_slot, + (void *)APR_OFFSETOF(server_rec, error_fname), RSRC_CONF, + "The filename of the error log"), +@@ -4934,8 +4959,7 @@ + + if (!saved_server_config_defines) + init_config_defines(pconf); +- apr_pool_cleanup_register(pconf, NULL, reset_config_defines, +- apr_pool_cleanup_null); ++ apr_pool_cleanup_register(pconf, NULL, reset_config, apr_pool_cleanup_null); + + ap_regcomp_set_default_cflags(AP_REG_DOLLAR_ENDONLY); + +@@ -5163,6 +5187,27 @@ + } + } + ++AP_DECLARE(char *) ap_state_dir_relative(apr_pool_t *p, const char *file) ++{ ++ char *newpath = NULL; ++ apr_status_t rv; ++ const char *state_dir; ++ ++ state_dir = core_state_dir ++ ? core_state_dir ++ : ap_server_root_relative(p, DEFAULT_REL_STATEDIR); ++ ++ rv = apr_filepath_merge(&newpath, state_dir, file, APR_FILEPATH_TRUENAME, p); ++ if (newpath && (rv == APR_SUCCESS || APR_STATUS_IS_EPATHWILD(rv) ++ || APR_STATUS_IS_ENOENT(rv) ++ || APR_STATUS_IS_ENOTDIR(rv))) { ++ return newpath; ++ } ++ else { ++ return NULL; ++ } ++} ++ + static apr_random_t *rng = NULL; + #if APR_HAS_THREADS + static apr_thread_mutex_t *rng_mutex = NULL; diff --git a/httpd.spec b/httpd.spec index 00094c6..9351fde 100644 --- a/httpd.spec +++ b/httpd.spec @@ -13,7 +13,7 @@ Summary: Apache HTTP Server Name: httpd Version: 2.4.39 -Release: 4%{?dist} +Release: 5%{?dist} URL: https://httpd.apache.org/ Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 Source1: index.html @@ -63,7 +63,7 @@ Patch3: httpd-2.4.1-deplibs.patch # Needed for socket activation and mod_systemd patch Patch19: httpd-2.4.25-detect-systemd.patch # Features/functional changes -Patch21: httpd-2.4.37-r1842929+.patch +Patch21: httpd-2.4.39-r1842929+.patch Patch23: httpd-2.4.33-export.patch Patch24: httpd-2.4.1-corelimit.patch Patch25: httpd-2.4.25-selinux.patch @@ -737,6 +737,9 @@ exit $rv %{_rpmconfigdir}/macros.d/macros.httpd %changelog +* Wed Jun 12 2019 Joe Orton - 2.4.39-5 +- fixes for StateDir directive (upstream r1857731, r1857731) + * Thu May 02 2019 Lubos Uhliarik - 2.4.39-4 - httpd dependency on initscripts is unspecified (#1705188)