842ae4bd224140319ae7feec1872b93dfd491143fielding/* Licensed to the Apache Software Foundation (ASF) under one or more
842ae4bd224140319ae7feec1872b93dfd491143fielding * contributor license agreements. See the NOTICE file distributed with
842ae4bd224140319ae7feec1872b93dfd491143fielding * this work for additional information regarding copyright ownership.
842ae4bd224140319ae7feec1872b93dfd491143fielding * The ASF licenses this file to You under the Apache License, Version 2.0
842ae4bd224140319ae7feec1872b93dfd491143fielding * (the "License"); you may not use this file except in compliance with
842ae4bd224140319ae7feec1872b93dfd491143fielding * the License. You may obtain a copy of the License at
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * Unless required by applicable law or agreed to in writing, software
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * distributed under the License is distributed on an "AS IS" BASIS,
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * See the License for the specific language governing permissions and
ce9621257ef9e54c1bbe5ad8a5f445a1f211c2dcnd * limitations under the License.
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * http_alias.c: Stuff for dealing with directory aliases
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * Original by Rob McCool, rewritten in succession by David Robinson
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingtypedef struct {
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingtypedef struct {
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingtypedef struct {
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *create_alias_config(apr_pool_t *p, server_rec *s)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_server_conf *) apr_pcalloc(p, sizeof(alias_server_conf));
066877f1a045103acfdd376d48cdd473c33f409bdougm a->aliases = apr_array_make(p, 20, sizeof(alias_entry));
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_make(p, 20, sizeof(alias_entry));
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *create_alias_dir_config(apr_pool_t *p, char *d)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_dir_conf *) apr_pcalloc(p, sizeof(alias_dir_conf));
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_make(p, 2, sizeof(alias_entry));
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *merge_alias_config(apr_pool_t *p, void *basev, void *overridesv)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_server_conf *) apr_pcalloc(p, sizeof(alias_server_conf));
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_server_conf *base = (alias_server_conf *) basev;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_server_conf *overrides = (alias_server_conf *) overridesv;
066877f1a045103acfdd376d48cdd473c33f409bdougm a->aliases = apr_array_append(p, overrides->aliases, base->aliases);
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_append(p, overrides->redirects, base->redirects);
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmstatic void *merge_alias_dir_config(apr_pool_t *p, void *basev, void *overridesv)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm (alias_dir_conf *) apr_pcalloc(p, sizeof(alias_dir_conf));
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_dir_conf *base = (alias_dir_conf *) basev;
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz alias_dir_conf *overrides = (alias_dir_conf *) overridesv;
066877f1a045103acfdd376d48cdd473c33f409bdougm a->redirects = apr_array_append(p, overrides->redirects, base->redirects);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin a->alias = (overrides->alias_set == 0) ? base->alias : overrides->alias;
291eb44b3adaf8247425286615b4f4b69fbea274minfrin a->handler = (overrides->alias_set == 0) ? base->handler : overrides->handler;
291eb44b3adaf8247425286615b4f4b69fbea274minfrin a->alias_set = overrides->alias_set || base->alias_set;
291eb44b3adaf8247425286615b4f4b69fbea274minfrin a->redirect = (overrides->redirect_set == 0) ? base->redirect : overrides->redirect;
291eb44b3adaf8247425286615b4f4b69fbea274minfrin a->redirect_status = (overrides->redirect_set == 0) ? base->redirect_status : overrides->redirect_status;
291eb44b3adaf8247425286615b4f4b69fbea274minfrin a->redirect_set = overrides->redirect_set || base->redirect_set;
4d7e28c869788fb00bffda29a67f1b10e19f159dnd/* need prototype for overlap check */
4d7e28c869788fb00bffda29a67f1b10e19f159dndstatic int alias_matches(const char *uri, const char *alias_fakename);
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_alias_internal(cmd_parms *cmd, void *dummy,
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein alias_server_conf *conf = ap_get_module_config(s->module_config,
4d7e28c869788fb00bffda29a67f1b10e19f159dnd alias_entry *entries = (alias_entry *)conf->aliases->elts;
18413e519b6e5d05ff00d18efd784307442ca2f3igalic /* XXX: real can NOT be relative to DocumentRoot here... compat bug. */
291eb44b3adaf8247425286615b4f4b69fbea274minfrin const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE);
36d38d22e0d385db01f5773a579f44b8f02e4b1fsf new->regexp = ap_pregcomp(cmd->pool, fake, AP_REG_EXTENDED);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Regular expression could not be compiled.";
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe /* XXX This may be optimized, but we must know that new->real
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * exists. If so, we can dir merge later, trusing new->real
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * and just canonicalizing the remainder. Not till I finish
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * cleaning out the old ap_canonical stuff first.
4d7e28c869788fb00bffda29a67f1b10e19f159dnd /* check for overlapping (Script)Alias directives
4d7e28c869788fb00bffda29a67f1b10e19f159dnd * and throw a warning if found one
36d38d22e0d385db01f5773a579f44b8f02e4b1fsf if ( (!alias->regexp && alias_matches(fake, alias->fake) > 0)
36d38d22e0d385db01f5773a579f44b8f02e4b1fsf || (alias->regexp && !ap_regexec(alias->regexp, fake, 0, NULL, 0))) {
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd->server, APLOGNO(00671)
1f0ca94141196628ecadf1a91f2b60a33349872fnd "The %s directive in %s at line %d will probably "
1f0ca94141196628ecadf1a91f2b60a33349872fnd "never match because it overlaps an earlier "
1f0ca94141196628ecadf1a91f2b60a33349872fnd "%sAlias%s.",
4d7e28c869788fb00bffda29a67f1b10e19f159dnd break; /* one warning per alias should be sufficient */
36d38d22e0d385db01f5773a579f44b8f02e4b1fsfstatic const char *add_alias(cmd_parms *cmd, void *dummy, const char *fake,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin const char *real)
291eb44b3adaf8247425286615b4f4b69fbea274minfrin return add_alias_internal(cmd, dummy, fake, real, 0);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin const char *err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin return "Alias must have two arguments when used globally";
291eb44b3adaf8247425286615b4f4b69fbea274minfrin ap_expr_parse_cmd(cmd, fake, AP_EXPR_FLAG_STRING_RESULT,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin "Cannot parse alias expression '", fake, "': ", err,
36d38d22e0d385db01f5773a579f44b8f02e4b1fsfstatic const char *add_alias_regex(cmd_parms *cmd, void *dummy,
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein alias_server_conf *serverconf = ap_get_module_config(s->module_config,
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * Logic flow:
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * Go ahead and try to grok the 1st arg, in case it is a
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * Redirect status. Now if we have 3 args, we expect that
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * we were able to understand that 1st argument (it's something
afadb90f859c4987505e745edee656850d7f8d49jim * we expected, so if not, then we bail
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim return "Redirect: invalid first argument (of three)";
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * if we have the 2nd arg and we understand the 1st one, or if we have the
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * 1st arg but don't understand it, we use the expression syntax assuming
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * a path from the location.
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * if we understand the first arg but have no second arg, we are dealing
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * with a status like "GONE".
291eb44b3adaf8247425286615b4f4b69fbea274minfrin if (grokarg1 && arg2 && !arg3 && HTTP_GONE != status) {
291eb44b3adaf8247425286615b4f4b69fbea274minfrin ap_expr_parse_cmd(cmd, arg2, AP_EXPR_FLAG_STRING_RESULT,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin "Cannot parse redirect expression '", arg2, "': ", expr_err,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin else if (grokarg1 && !arg2 && HTTP_GONE == status) {
291eb44b3adaf8247425286615b4f4b69fbea274minfrin ap_expr_parse_cmd(cmd, arg1, AP_EXPR_FLAG_STRING_RESULT,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin "Cannot parse redirect expression '", arg1, "': ", expr_err,
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * if we don't have the 3rd arg and we didn't understand the 1st
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * one, then assume URL-path URL. This also handles case, eg, GONE
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * we even though we don't have a 3rd arg, we did understand the 1st
f23a64b4e8a5f213b2aafb2bf6775e883e21f05fjim * one, so we don't want to re-arrange
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Regular expression could not be compiled.";
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "URL to redirect to is missing";
c7ab5a433d38d5eae5fc0bb76be80ffab6e4f71dniq /* PR#35314: we can allow path components here;
c7ab5a433d38d5eae5fc0bb76be80ffab6e4f71dniq * they get correctly resolved to full URLs.
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Redirect to non-URL";
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz return "Redirect URL not valid for this status";
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect(cmd_parms *cmd, void *dirconf,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *arg3)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 0);
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect2(cmd_parms *cmd, void *dirconf,
a7ad08f37d876bde1a32f0cf793f4799536ab1a5ben return add_redirect_internal(cmd, dirconf, arg1, arg2, NULL, 0);
a7ad08f37d876bde1a32f0cf793f4799536ab1a5benstatic const char *add_redirect_regex(cmd_parms *cmd, void *dirconf,
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz const char *arg3)
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding return add_redirect_internal(cmd, dirconf, arg1, arg2, arg3, 1);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin AP_INIT_TAKE12("Alias", add_alias, NULL, RSRC_CONF | ACCESS_CONF,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin "a fakename and a realname, or a realname in a Location"),
291eb44b3adaf8247425286615b4f4b69fbea274minfrin AP_INIT_TAKE12("ScriptAlias", add_alias, "cgi-script", RSRC_CONF | ACCESS_CONF,
291eb44b3adaf8247425286615b4f4b69fbea274minfrin "a fakename and a realname, or a realname in a Location"),
291eb44b3adaf8247425286615b4f4b69fbea274minfrin AP_INIT_TAKE123("Redirect", add_redirect, (void *) HTTP_MOVED_TEMPORARILY,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "an optional status, then document to be redirected and "
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "destination URL"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE2("AliasMatch", add_alias_regex, NULL, RSRC_CONF,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a regular expression and a filename"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick AP_INIT_TAKE2("ScriptAliasMatch", add_alias_regex, "cgi-script", RSRC_CONF,
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a regular expression and a filename"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "an optional status, then a regular expression and "
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "destination URL"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a document to be redirected, then the destination URL"),
4f9a74ad7e44b0464f7cf56525a205d788becacbtrawick "a document to be redirected, then the destination URL"),
0f081398cf0eef8cc7c66a535d450110a92dc8aefieldingstatic int alias_matches(const char *uri, const char *alias_fakename)
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* any number of '/' in the alias matches any number in
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz * the supplied URI, but there must be at least one...
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* Other characters are compared literally */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* Check last alias path component matched all the way */
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding if (aliasp[-1] != '/' && *urip != '\0' && *urip != '/')
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* Return number of characters from URI which matched (may be
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * greater than length of alias, since we may have matched
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding * doubled slashes)
291eb44b3adaf8247425286615b4f4b69fbea274minfrin (alias_dir_conf *) ap_get_module_config(r->per_dir_config, &alias_module);
337489fc0f19fa2ccac530ca0e2de9fe60f28e09ylavic ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02825)
291eb44b3adaf8247425286615b4f4b69fbea274minfrin if (dirconf->handler) { /* Set handler, and leave a note for mod_cgi */
291eb44b3adaf8247425286615b4f4b69fbea274minfrin apr_table_setn(r->notes, "alias-forced-type", r->handler);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin /* XXX This is as SLOW as can be, next step, we optimize
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * and merge to whatever part of the found path was already
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * canonicalized. After I finish eliminating os canonical.
291eb44b3adaf8247425286615b4f4b69fbea274minfrin * Better fail test for ap_server_root_relative needed here.
291eb44b3adaf8247425286615b4f4b69fbea274minfrinstatic char *try_redirect(request_rec *r, int *status)
291eb44b3adaf8247425286615b4f4b69fbea274minfrin (alias_dir_conf *) ap_get_module_config(r->per_dir_config, &alias_module);
337489fc0f19fa2ccac530ca0e2de9fe60f28e09ylavic ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02826)
291eb44b3adaf8247425286615b4f4b69fbea274minfrin /* Do not escape the query string or fragment. */
291eb44b3adaf8247425286615b4f4b69fbea274minfrin found = apr_uri_unparse(r->pool, &uri, APR_URI_UNP_OMITQUERY);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin found = apr_pstrcat(r->pool, found, "?", uri.query, NULL);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin found = apr_pstrcat(r->pool, found, "#", uri.fragment, NULL);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantzstatic char *try_alias_list(request_rec *r, apr_array_header_t *aliases,
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding alias_entry *entries = (alias_entry *) aliases->elts;
36d38d22e0d385db01f5773a579f44b8f02e4b1fsf if (!ap_regexec(alias->regexp, r->uri, AP_MAX_REG_MATCH, regm, 0)) {
33510984c759eb3da154ceb0db9b75fa0031d3b4sf /* Do not escape the query string or fragment. */
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00672)
4c138e467a7d384582aa6f8c9809af589e572feesf "Regex substitution in '%s' failed. "
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz /* need something non-null */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz if (l > 0) {
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz escurl = ap_os_escape_path(r->pool, r->uri + l, 1);
36d38d22e0d385db01f5773a579f44b8f02e4b1fsf found = apr_pstrcat(r->pool, alias->real, r->uri + l, NULL);
36d38d22e0d385db01f5773a579f44b8f02e4b1fsf if (alias->handler) { /* Set handler, and leave a note for mod_cgi */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz apr_table_setn(r->notes, "alias-forced-type", r->handler);
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe /* XXX This is as SLOW as can be, next step, we optimize
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * and merge to whatever part of the found path was already
9bf4319b4fc7b31295b945215a55e2a92ba57903wrowe * canonicalized. After I finish eliminating os canonical.
32c4bc04f89b16521718145dc731f750144d7b38wrowe * Better fail test for ap_server_root_relative needed here.
a6b9ed64fdf548c61de9714e2cfb999ec59d149cgstein alias_server_conf *serverconf = ap_get_module_config(sconf, &alias_module);
291eb44b3adaf8247425286615b4f4b69fbea274minfrin || (ret = try_alias_list(r, serverconf->redirects, 1, &status))
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00673)
30e3e760b737f13ce800fa02c5930ade7659ba66niq "incomplete redirection target of '%s' for "
30e3e760b737f13ce800fa02c5930ade7659ba66niq "URI '%s' modified to '%s'",
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00674)
30e3e760b737f13ce800fa02c5930ade7659ba66niq "cannot redirect '%s' to '%s'; "
30e3e760b737f13ce800fa02c5930ade7659ba66niq "target is not a valid absoluteURI or abs_path",
30e3e760b737f13ce800fa02c5930ade7659ba66niq /* append requested query only, if the config didn't
30e3e760b737f13ce800fa02c5930ade7659ba66niq * supply its own.
291eb44b3adaf8247425286615b4f4b69fbea274minfrin || (ret = try_alias_list(r, serverconf->aliases, 0, &status))
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding (alias_dir_conf *) ap_get_module_config(dconf, &alias_module);
0f081398cf0eef8cc7c66a535d450110a92dc8aefielding /* It may have changed since last time, so try again */
291eb44b3adaf8247425286615b4f4b69fbea274minfrin || (ret = try_alias_list(r, dirconf->redirects, 1, &status))
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00675)
449efc4dc68e42cc4421d15498a689618aab5dc3coar "incomplete redirection target of '%s' for "
449efc4dc68e42cc4421d15498a689618aab5dc3coar "URI '%s' modified to '%s'",
185aa71728867671e105178b4c66fbc22b65ae26sf ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(00676)
a877b7d5d03f91d6c93076d9ccf14469c70c648dcoar "cannot redirect '%s' to '%s'; "
449efc4dc68e42cc4421d15498a689618aab5dc3coar "target is not a valid absoluteURI or abs_path",
affb82a2d7fc07c1a862d800ef47af966b898768nd /* append requested query only, if the config didn't
affb82a2d7fc07c1a862d800ef47af966b898768nd * supply its own.
e8c95302287c86cd1f984eeb25cf3bfa9e2d33bbslive static const char * const aszSucc[]={ "mod_userdir.c",
1376737cb6afa24d3e12f3a223318fe1bd71bb1fslive ap_hook_translate_name(translate_alias_redir,NULL,aszSucc,APR_HOOK_MIDDLE);
b980ad7fdc218b4855cde9f75a747527f50c554dwrowe ap_hook_fixups(fixup_redir,NULL,NULL,APR_HOOK_MIDDLE);
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz create_alias_dir_config, /* dir config creater */
076ae4ad21f0b3f25e2feabd9886b9500929eb2ejerenkrantz merge_alias_dir_config, /* dir merger --- default is to override */