52cd1a
# ./pullrev.sh 1692801 1694012
52cd1a
52cd1a
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2015-3184
52cd1a
52cd1a
http://svn.apache.org/viewvc?view=revision&revision=1692801
52cd1a
http://svn.apache.org/viewvc?view=revision&revision=1694012
52cd1a
52cd1a
Excludes CVE-2015-3187 changes.  This patch requires an httpd
52cd1a
patched with the new API introduced for CVE-2015-3185.
52cd1a
52cd1a
--- subversion-1.7.14/build/ac-macros/apache.m4.cve3184
52cd1a
+++ subversion-1.7.14/build/ac-macros/apache.m4
52cd1a
@@ -85,6 +85,25 @@ VERSION_OKAY
52cd1a
         AC_MSG_RESULT(no - Unable to locate $APXS_INCLUDE/mod_dav.h)
52cd1a
         APXS=""
52cd1a
     fi
52cd1a
+    HTTPD="`$APXS -q sbindir`/`$APXS -q PROGNAME`"
52cd1a
+    if ! test -e $HTTPD ; then
52cd1a
+      HTTPD="`$APXS -q bindir`/`$APXS -q PROGNAME`"
52cd1a
+    fi
52cd1a
+    HTTPD_VERSION=["`$HTTPD -v | $SED -e 's@^.*/\([0-9.]*\)\(.*$\)@\1@ ; 1q'`"]
52cd1a
+    AC_ARG_ENABLE(broken-httpd-auth,
52cd1a
+      AS_HELP_STRING([--enable-broken-httpd-auth],
52cd1a
+                     [Allow building against httpd 2.4 with broken auth]),
52cd1a
+      [broken_httpd_auth=$enableval],[broken_httpd_auth=no])
52cd1a
+    if test "$enable_broken_httpd_auth" = "backport"; then
52cd1a
+      AC_MSG_NOTICE([Building with httpd as if 2.4.17 or later])
52cd1a
+      HTTPD_VERSION=2.4.17
52cd1a
+      AC_DEFINE(SVN_ALLOW_BROKEN_HTTPD_AUTH, 1,
52cd1a
+                [Defined to allow building against httpd 2.4 with broken auth])
52cd1a
+    elif test "$enable_broken_httpd_auth" = "yes"; then
52cd1a
+      AC_MSG_NOTICE([Building with broken httpd auth])
52cd1a
+      AC_DEFINE(SVN_ALLOW_BROKEN_HTTPD_AUTH, 1,
52cd1a
+                [Defined to allow building against httpd 2.4 with broken auth])
52cd1a
+    fi
52cd1a
 else
52cd1a
     AC_MSG_RESULT(no)
52cd1a
 fi
52cd1a
@@ -157,6 +176,7 @@ AC_SUBST(APXS)
52cd1a
 AC_SUBST(APACHE_LDFLAGS)
52cd1a
 AC_SUBST(APACHE_INCLUDES)
52cd1a
 AC_SUBST(APACHE_LIBEXECDIR)
52cd1a
+AC_SUBST(HTTPD_VERSION)
52cd1a
 
52cd1a
 # there aren't any flags that interest us ...
52cd1a
 #if test -n "$APXS" && test "$APXS" != "no"; then
52cd1a
--- subversion-1.7.14/build/run_tests.py.cve3184
52cd1a
+++ subversion-1.7.14/build/run_tests.py
52cd1a
@@ -29,6 +29,7 @@
52cd1a
             [--fs-type=<fs-type>] [--fsfs-packing] [--fsfs-sharding=<n>]
52cd1a
             [--list] [--milestone-filter=<regex>] [--mode-filter=<type>]
52cd1a
             [--server-minor-version=<version>]
52cd1a
+            [--httpd-version=<version>]
52cd1a
             [--config-file=<file>]
52cd1a
             <abs_srcdir> <abs_builddir>
52cd1a
             <prog ...>
52cd1a
@@ -81,7 +82,7 @@ class TestHarness:
52cd1a
                cleanup=None, enable_sasl=None, parallel=None, config_file=None,
52cd1a
                fsfs_sharding=None, fsfs_packing=None,
52cd1a
                list_tests=None, svn_bin=None, mode_filter=None,
52cd1a
-               milestone_filter=None):
52cd1a
+               milestone_filter=None, httpd_version=None):
52cd1a
     '''Construct a TestHarness instance.
52cd1a
 
52cd1a
     ABS_SRCDIR and ABS_BUILDDIR are the source and build directories.
52cd1a
@@ -130,6 +131,7 @@ class TestHarness:
52cd1a
     self.svn_bin = svn_bin
52cd1a
     self.mode_filter = mode_filter
52cd1a
     self.log = None
52cd1a
+    self.httpd_version = httpd_version
52cd1a
     if not sys.stdout.isatty() or sys.platform == 'win32':
52cd1a
       TextColors.disable()
52cd1a
 
52cd1a
@@ -414,6 +416,8 @@ class TestHarness:
52cd1a
       svntest.main.options.fsfs_packing = self.fsfs_packing
52cd1a
     if self.mode_filter is not None:
52cd1a
       svntest.main.options.mode_filter = self.mode_filter
52cd1a
+    if self.httpd_version is not None:
52cd1a
+      svntest.main.options.httpd_version = self.httpd_version
52cd1a
 
52cd1a
     svntest.main.options.srcdir = self.srcdir
52cd1a
 
52cd1a
@@ -562,7 +566,7 @@ def main():
52cd1a
                             'fsfs-packing', 'fsfs-sharding=',
52cd1a
                             'enable-sasl', 'parallel', 'config-file=',
52cd1a
                             'log-to-stdout', 'list', 'milestone-filter=',
52cd1a
-                            'mode-filter='])
52cd1a
+                            'mode-filter=', 'httpd-version='])
52cd1a
   except getopt.GetoptError:
52cd1a
     args = []
52cd1a
 
52cd1a
@@ -572,9 +576,10 @@ def main():
52cd1a
 
52cd1a
   base_url, fs_type, verbose, cleanup, enable_sasl, http_library, \
52cd1a
     server_minor_version, fsfs_sharding, fsfs_packing, parallel, \
52cd1a
-    config_file, log_to_stdout, list_tests, mode_filter, milestone_filter= \
52cd1a
+    config_file, log_to_stdout, list_tests, mode_filter, milestone_filter, \
52cd1a
+    httpd_version = \
52cd1a
             None, None, None, None, None, None, None, None, None, None, None, \
52cd1a
-            None, None, None, None
52cd1a
+            None, None, None, None, None
52cd1a
   for opt, val in opts:
52cd1a
     if opt in ['-u', '--url']:
52cd1a
       base_url = val
52cd1a
@@ -606,6 +611,8 @@ def main():
52cd1a
       milestone_filter = val
52cd1a
     elif opt in ['--mode-filter']:
52cd1a
       mode_filter = val
52cd1a
+    elif opt in ['--httpd-version']:
52cd1a
+      httpd_version = val
52cd1a
     else:
52cd1a
       raise getopt.GetoptError
52cd1a
 
52cd1a
@@ -620,7 +627,8 @@ def main():
52cd1a
                    base_url, fs_type, http_library, server_minor_version,
52cd1a
                    verbose, cleanup, enable_sasl, parallel, config_file,
52cd1a
                    fsfs_sharding, fsfs_packing, list_tests,
52cd1a
-                   mode_filter=mode_filter, milestone_filter=milestone_filter)
52cd1a
+                   mode_filter=mode_filter, milestone_filter=milestone_filter,
52cd1a
+                   httpd_version=httpd_version)
52cd1a
 
52cd1a
   failed = th.run(args[2:])
52cd1a
   if failed:
52cd1a
--- subversion-1.7.14/Makefile.in.cve3184
52cd1a
+++ subversion-1.7.14/Makefile.in
52cd1a
@@ -319,6 +319,7 @@ INSTALL_EXTRA_SWIG_RB=\
52cd1a
   done
52cd1a
 
52cd1a
 APXS = @APXS@
52cd1a
+HTTPD_VERSION = @HTTPD_VERSION@
52cd1a
 
52cd1a
 PYTHON = @PYTHON@
52cd1a
 PERL = @PERL@
52cd1a
@@ -466,6 +467,9 @@ check: bin @TRANSFORM_LIBTOOL_SCRIPTS@ $
52cd1a
 	  if test "$(HTTP_LIBRARY)" != ""; then                              \
52cd1a
 	    flags="--http-library $(HTTP_LIBRARY) $$flags";                  \
52cd1a
 	  fi;                                                                \
52cd1a
+	  if test "$(HTTPD_VERSION)" != ""; then                             \
52cd1a
+	    flags="--httpd-version $(HTTPD_VERSION) $$flags";                \
52cd1a
+	  fi;                                                                \
52cd1a
 	  if test "$(SERVER_MINOR_VERSION)" != ""; then                      \
52cd1a
 	    flags="--server-minor-version $(SERVER_MINOR_VERSION) $$flags";  \
52cd1a
 	  fi;                                                                \
52cd1a
--- subversion-1.7.14/subversion/mod_authz_svn/mod_authz_svn.c.cve3184
52cd1a
+++ subversion-1.7.14/subversion/mod_authz_svn/mod_authz_svn.c
52cd1a
@@ -48,6 +48,23 @@
52cd1a
 #include "svn_dirent_uri.h"
52cd1a
 #include "private/svn_fspath.h"
52cd1a
 
52cd1a
+/* The apache headers define these and they conflict with our definitions. */
52cd1a
+#ifdef PACKAGE_BUGREPORT
52cd1a
+#undef PACKAGE_BUGREPORT
52cd1a
+#endif
52cd1a
+#ifdef PACKAGE_NAME
52cd1a
+#undef PACKAGE_NAME
52cd1a
+#endif
52cd1a
+#ifdef PACKAGE_STRING
52cd1a
+#undef PACKAGE_STRING
52cd1a
+#endif
52cd1a
+#ifdef PACKAGE_TARNAME
52cd1a
+#undef PACKAGE_TARNAME
52cd1a
+#endif
52cd1a
+#ifdef PACKAGE_VERSION
52cd1a
+#undef PACKAGE_VERSION
52cd1a
+#endif
52cd1a
+#include "svn_private_config.h"
52cd1a
 
52cd1a
 extern module AP_MODULE_DECLARE_DATA authz_svn_module;
52cd1a
 
52cd1a
@@ -65,6 +82,30 @@ typedef struct authz_svn_config_rec {
52cd1a
   const char *force_username_case;
52cd1a
 } authz_svn_config_rec;
52cd1a
 
52cd1a
+#if AP_MODULE_MAGIC_AT_LEAST(20060110,0) /* version where
52cd1a
+                                            ap_some_auth_required breaks */
52cd1a
+#  if 1 || AP_MODULE_MAGIC_AT_LEAST(20120211,47) /* first version with
52cd1a
+                                               force_authn hook and
52cd1a
+                                               ap_some_authn_required() which
52cd1a
+                                               allows us to work without
52cd1a
+                                               ap_some_auth_required() */
52cd1a
+#    define USE_FORCE_AUTHN 1
52cd1a
+#    define IN_SOME_AUTHN_NOTE "authz_svn-in-some-authn"
52cd1a
+#    define FORCE_AUTHN_NOTE "authz_svn-force-authn"
52cd1a
+#  else
52cd1a
+     /* ap_some_auth_required() is busted and no viable alternative exists */
52cd1a
+#    ifndef SVN_ALLOW_BROKEN_HTTPD_AUTH
52cd1a
+#      error This version of httpd has a security hole with mod_authz_svn
52cd1a
+#    else
52cd1a
+       /* user wants to build anyway */
52cd1a
+#      define USE_FORCE_AUTHN 0
52cd1a
+#    endif
52cd1a
+#  endif
52cd1a
+#else
52cd1a
+   /* old enough that ap_some_auth_required() still works */
52cd1a
+#  define USE_FORCE_AUTHN 0
52cd1a
+#endif
52cd1a
+
52cd1a
 /*
52cd1a
  * Configuration
52cd1a
  */
52cd1a
@@ -682,7 +723,49 @@ access_checker(request_rec *r)
52cd1a
                                                     &authz_svn_module);
52cd1a
   const char *repos_path = NULL;
52cd1a
   const char *dest_repos_path = NULL;
52cd1a
-  int status;
52cd1a
+  int status, authn_required;
52cd1a
+
52cd1a
+#if USE_FORCE_AUTHN
52cd1a
+  /* Use the force_authn() hook available in 2.4.x to work securely
52cd1a
+   * given that ap_some_auth_required() is no longer functional for our
52cd1a
+   * purposes in 2.4.x.
52cd1a
+   */
52cd1a
+  int authn_configured;
52cd1a
+
52cd1a
+  /* We are not configured to run */
52cd1a
+  if (!conf->anonymous || apr_table_get(r->notes, IN_SOME_AUTHN_NOTE)
52cd1a
+      || (! (conf->access_file || conf->repo_relative_access_file)))
52cd1a
+    return DECLINED;
52cd1a
+
52cd1a
+  /* Authentication is configured */
52cd1a
+  authn_configured = ap_auth_type(r) != NULL;
52cd1a
+  if (authn_configured)
52cd1a
+    {
52cd1a
+      /* If the user is trying to authenticate, let him.  It doesn't
52cd1a
+       * make much sense to grant anonymous access but deny authenticated
52cd1a
+       * users access, even though you can do that with '$anon' in the
52cd1a
+       * access file.
52cd1a
+       */
52cd1a
+      if (apr_table_get(r->headers_in,
52cd1a
+                        (PROXYREQ_PROXY == r->proxyreq)
52cd1a
+                        ? "Proxy-Authorization" : "Authorization"))
52cd1a
+        {
52cd1a
+          /* Set the note to force authn regardless of what access_checker_ex
52cd1a
+             hook requires */
52cd1a
+          apr_table_setn(r->notes, FORCE_AUTHN_NOTE, (const char*)1);
52cd1a
+
52cd1a
+          /* provide the proper return so the access_checker hook doesn't
52cd1a
+           * prevent the code from continuing on to the other auth hooks */
52cd1a
+          if (ap_satisfies(r) != SATISFY_ANY)
52cd1a
+            return OK;
52cd1a
+          else
52cd1a
+            return HTTP_FORBIDDEN;
52cd1a
+        }
52cd1a
+    }    
52cd1a
+
52cd1a
+#else
52cd1a
+  /* Support for older versions of httpd that have a working
52cd1a
+   * ap_some_auth_required() */
52cd1a
 
52cd1a
   /* We are not configured to run */
52cd1a
   if (!conf->anonymous
52cd1a
@@ -697,9 +780,10 @@ access_checker(request_rec *r)
52cd1a
       if (ap_satisfies(r) != SATISFY_ANY)
52cd1a
         return DECLINED;
52cd1a
 
52cd1a
-      /* If the user is trying to authenticate, let him.  If anonymous
52cd1a
-       * access is allowed, so is authenticated access, by definition
52cd1a
-       * of the meaning of '*' in the access file.
52cd1a
+      /* If the user is trying to authenticate, let him.  It doesn't
52cd1a
+       * make much sense to grant anonymous access but deny authenticated
52cd1a
+       * users access, even though you can do that with '$anon' in the
52cd1a
+       * access file.
52cd1a
        */
52cd1a
       if (apr_table_get(r->headers_in,
52cd1a
                         (PROXYREQ_PROXY == r->proxyreq)
52cd1a
@@ -711,6 +795,7 @@ access_checker(request_rec *r)
52cd1a
           return HTTP_FORBIDDEN;
52cd1a
         }
52cd1a
     }
52cd1a
+#endif
52cd1a
 
52cd1a
   /* If anon access is allowed, return OK */
52cd1a
   status = req_check_access(r, conf, &repos_path, &dest_repos_path);
52cd1a
@@ -719,7 +804,26 @@ access_checker(request_rec *r)
52cd1a
       if (!conf->authoritative)
52cd1a
         return DECLINED;
52cd1a
 
52cd1a
+#if USE_FORCE_AUTHN
52cd1a
+      if (authn_configured) {
52cd1a
+          /* We have to check to see if authn is required because if so we must
52cd1a
+           * return UNAUTHORIZED (401) rather than FORBIDDEN (403) since returning
52cd1a
+           * the 403 leaks information about what paths may exist to
52cd1a
+           * unauthenticated users.  We must set a note here in order
52cd1a
+           * to use ap_some_authn_rquired() without triggering an infinite
52cd1a
+           * loop since the call will trigger this function to be called again. */
52cd1a
+          apr_table_setn(r->notes, IN_SOME_AUTHN_NOTE, (const char*)1);
52cd1a
+          authn_required = ap_some_authn_required(r);
52cd1a
+          apr_table_unset(r->notes, IN_SOME_AUTHN_NOTE);
52cd1a
+          if (authn_required)
52cd1a
+            {
52cd1a
+              ap_note_auth_failure(r);
52cd1a
+              return HTTP_UNAUTHORIZED;
52cd1a
+            }
52cd1a
+      }
52cd1a
+#else
52cd1a
       if (!ap_some_auth_required(r))
52cd1a
+#endif
52cd1a
         log_access_verdict(APLOG_MARK, r, 0, repos_path, dest_repos_path);
52cd1a
 
52cd1a
       return HTTP_FORBIDDEN;
52cd1a
@@ -800,6 +904,17 @@ auth_checker(request_rec *r)
52cd1a
   return OK;
52cd1a
 }
52cd1a
 
52cd1a
+#if USE_FORCE_AUTHN
52cd1a
+static int
52cd1a
+force_authn(request_rec *r)
52cd1a
+{
52cd1a
+  if (apr_table_get(r->notes, FORCE_AUTHN_NOTE))
52cd1a
+    return OK;
52cd1a
+
52cd1a
+  return DECLINED;
52cd1a
+}
52cd1a
+#endif
52cd1a
+
52cd1a
 /*
52cd1a
  * Module flesh
52cd1a
  */
52cd1a
@@ -816,6 +931,9 @@ register_hooks(apr_pool_t *p)
52cd1a
    * give SSLOptions +FakeBasicAuth a chance to work. */
52cd1a
   ap_hook_check_user_id(check_user_id, mod_ssl, NULL, APR_HOOK_FIRST);
52cd1a
   ap_hook_auth_checker(auth_checker, NULL, NULL, APR_HOOK_FIRST);
52cd1a
+#if USE_FORCE_AUTHN
52cd1a
+  ap_hook_force_authn(force_authn, NULL, NULL, APR_HOOK_FIRST);
52cd1a
+#endif
52cd1a
   ap_register_provider(p,
52cd1a
                        AUTHZ_SVN__SUBREQ_BYPASS_PROV_GRP,
52cd1a
                        AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME,
52cd1a
--- subversion-1.7.14/subversion/tests/cmdline/davautocheck.sh.cve3184
52cd1a
+++ subversion-1.7.14/subversion/tests/cmdline/davautocheck.sh
52cd1a
@@ -248,8 +248,6 @@ LOAD_MOD_AUTHN_CORE="$(get_loadmodule_co
52cd1a
     || fail "Authn_Core module not found."
52cd1a
 LOAD_MOD_AUTHZ_CORE="$(get_loadmodule_config mod_authz_core)" \
52cd1a
     || fail "Authz_Core module not found."
52cd1a
-LOAD_MOD_AUTHZ_HOST="$(get_loadmodule_config mod_authz_host)" \
52cd1a
-    || fail "Authz_Host module not found."
52cd1a
 LOAD_MOD_UNIXD=$(get_loadmodule_config mod_unixd) \
52cd1a
     || fail "UnixD module not found"
52cd1a
 }
52cd1a
@@ -257,6 +255,10 @@ LOAD_MOD_AUTHN_FILE="$(get_loadmodule_co
52cd1a
     || fail "Authn_File module not found."
52cd1a
 LOAD_MOD_AUTHZ_USER="$(get_loadmodule_config mod_authz_user)" \
52cd1a
     || fail "Authz_User module not found."
52cd1a
+LOAD_MOD_AUTHZ_GROUPFILE="$(get_loadmodule_config mod_authz_groupfile)" \
52cd1a
+    || fail "Authz_GroupFile module not found."
52cd1a
+LOAD_MOD_AUTHZ_HOST="$(get_loadmodule_config mod_authz_host)" \
52cd1a
+    || fail "Authz_Host module not found."
52cd1a
 }
52cd1a
 if [ ${APACHE_MPM:+set} ]; then
52cd1a
     LOAD_MOD_MPM=$(get_loadmodule_config mod_mpm_$APACHE_MPM) \
52cd1a
@@ -272,6 +274,7 @@ HTTPD_ERROR_LOG="$HTTPD_ROOT/error_log"
52cd1a
 HTTPD_MIME_TYPES="$HTTPD_ROOT/mime.types"
52cd1a
 BASE_URL="http://localhost:$HTTPD_PORT"
52cd1a
 HTTPD_USERS="$HTTPD_ROOT/users"
52cd1a
+HTTPD_GROUPS="$HTTPD_ROOT/groups"
52cd1a
 
52cd1a
 mkdir "$HTTPD_ROOT" \
52cd1a
   || fail "couldn't create temporary directory '$HTTPD_ROOT'"
52cd1a
@@ -281,6 +284,14 @@ say "Using directory '$HTTPD_ROOT'..."
52cd1a
 say "Adding users for lock authentication"
52cd1a
 $HTPASSWD -bc $HTTPD_USERS jrandom   rayjandom
52cd1a
 $HTPASSWD -b  $HTTPD_USERS jconstant rayjandom
52cd1a
+$HTPASSWD -b  $HTTPD_USERS JRANDOM   rayjandom
52cd1a
+$HTPASSWD -b  $HTTPD_USERS JCONSTANT rayjandom
52cd1a
+ 
52cd1a
+say "Adding groups for mod_authz_svn tests"
52cd1a
+cat > "$HTTPD_GROUPS" <<__EOF__
52cd1a
+random: jrandom
52cd1a
+constant: jconstant
52cd1a
+__EOF__
52cd1a
 
52cd1a
 touch $HTTPD_MIME_TYPES
52cd1a
 
52cd1a
@@ -297,7 +308,9 @@ $LOAD_MOD_AUTHN_CORE
52cd1a
 $LOAD_MOD_AUTHN_FILE
52cd1a
 $LOAD_MOD_AUTHZ_CORE
52cd1a
 $LOAD_MOD_AUTHZ_USER
52cd1a
+$LOAD_MOD_AUTHZ_GROUPFILE
52cd1a
 $LOAD_MOD_AUTHZ_HOST
52cd1a
+$LOAD_MOD_ACCESS_COMPAT
52cd1a
 LoadModule          authz_svn_module "$MOD_AUTHZ_SVN"
52cd1a
 
52cd1a
 __EOF__
52cd1a
@@ -369,6 +382,151 @@ CustomLog           "$HTTPD_ROOT/ops" "%
52cd1a
   SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
   ${SVN_PATH_AUTHZ_LINE}
52cd1a
 </Location>
52cd1a
+<Location /authz-test-work/anon>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  # This may seem unnecessary but granting access to everyone here is necessary
52cd1a
+  # to exercise a bug with httpd 2.3.x+.  The "Require all granted" syntax is
52cd1a
+  # new to 2.3.x+ which we can detect with the mod_authz_core.c module
52cd1a
+  # signature.  Use the "Allow from all" syntax with older versions for symmetry.
52cd1a
+  <IfModule mod_authz_core.c>
52cd1a
+    Require all granted
52cd1a
+  </IfModule>
52cd1a
+  <IfModule !mod_authz_core.c>
52cd1a
+    Allow from all
52cd1a
+  </IfMOdule>
52cd1a
+  ${SVN_PATH_AUTHZ_LINE}
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/mixed>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  Require           valid-user
52cd1a
+  Satisfy Any
52cd1a
+  ${SVN_PATH_AUTHZ_LINE}
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/mixed-noauthwhenanon>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  Require           valid-user
52cd1a
+  AuthzSVNNoAuthWhenAnonymousAllowed On
52cd1a
+  SVNPathAuthz On
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/authn>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  Require           valid-user
52cd1a
+  ${SVN_PATH_AUTHZ_LINE}
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/authn-anonoff>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  Require           valid-user
52cd1a
+  AuthzSVNAnonymous Off
52cd1a
+  SVNPathAuthz On
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/authn-lcuser>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  Require           valid-user
52cd1a
+  AuthzForceUsernameCase Lower
52cd1a
+  ${SVN_PATH_AUTHZ_LINE}
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/authn-lcuser>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  Require           valid-user
52cd1a
+  AuthzForceUsernameCase Lower
52cd1a
+  ${SVN_PATH_AUTHZ_LINE}
52cd1a
+</Location>
52cd1a
+<Location /authz-test-work/authn-group>
52cd1a
+  DAV               svn
52cd1a
+  SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+  AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+  SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+  SVNListParentPath On
52cd1a
+  AuthType          Basic
52cd1a
+  AuthName          "Subversion Repository"
52cd1a
+  AuthUserFile      $HTTPD_USERS
52cd1a
+  AuthGroupFile     $HTTPD_GROUPS
52cd1a
+  Require           group random
52cd1a
+  AuthzSVNAuthoritative Off
52cd1a
+  SVNPathAuthz On
52cd1a
+</Location>
52cd1a
+<IfModule mod_authz_core.c>
52cd1a
+  <Location /authz-test-work/sallrany>
52cd1a
+    DAV               svn
52cd1a
+    SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+    AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+    SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+    SVNListParentPath On
52cd1a
+    AuthType          Basic
52cd1a
+    AuthName          "Subversion Repository"
52cd1a
+    AuthUserFile      $HTTPD_USERS
52cd1a
+    AuthzSendForbiddenOnFailure On
52cd1a
+    Satisfy All
52cd1a
+    <RequireAny>
52cd1a
+      Require valid-user
52cd1a
+      Require expr req('ALLOW') == '1'
52cd1a
+    </RequireAny>
52cd1a
+    ${SVN_PATH_AUTHZ_LINE}
52cd1a
+  </Location>
52cd1a
+  <Location /authz-test-work/sallrall>
52cd1a
+    DAV               svn
52cd1a
+    SVNParentPath     "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
52cd1a
+    AuthzSVNAccessFile "$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
52cd1a
+    SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
52cd1a
+    SVNListParentPath On
52cd1a
+    AuthType          Basic
52cd1a
+    AuthName          "Subversion Repository"
52cd1a
+    AuthUserFile      $HTTPD_USERS
52cd1a
+    AuthzSendForbiddenOnFailure On
52cd1a
+    Satisfy All
52cd1a
+    <RequireAll>
52cd1a
+      Require valid-user
52cd1a
+      Require expr req('ALLOW') == '1'
52cd1a
+    </RequireAll>
52cd1a
+    ${SVN_PATH_AUTHZ_LINE}
52cd1a
+  </Location>
52cd1a
+</IfModule>
52cd1a
 RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)\$ /svn-test-work/repositories/\$1
52cd1a
 RedirectMatch           ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)\$ /svn-test-work/repositories/\$1
52cd1a
 __EOF__
52cd1a
--- subversion-1.7.14/subversion/tests/cmdline/mod_authz_svn_tests.py.cve3184
52cd1a
+++ subversion-1.7.14/subversion/tests/cmdline/mod_authz_svn_tests.py
52cd1a
@@ -0,0 +1,1073 @@
52cd1a
+#!/usr/bin/env python
52cd1a
+#
52cd1a
+#  mod_authz_svn_tests.py:  testing mod_authz_svn
52cd1a
+#
52cd1a
+#  Subversion is a tool for revision control.
52cd1a
+#  See http://subversion.apache.org for more information.
52cd1a
+#
52cd1a
+# ====================================================================
52cd1a
+#    Licensed to the Apache Software Foundation (ASF) under one
52cd1a
+#    or more contributor license agreements.  See the NOTICE file
52cd1a
+#    distributed with this work for additional information
52cd1a
+#    regarding copyright ownership.  The ASF licenses this file
52cd1a
+#    to you under the Apache License, Version 2.0 (the
52cd1a
+#    "License"); you may not use this file except in compliance
52cd1a
+#    with the License.  You may obtain a copy of the License at
52cd1a
+#
52cd1a
+#      http://www.apache.org/licenses/LICENSE-2.0
52cd1a
+#
52cd1a
+#    Unless required by applicable law or agreed to in writing,
52cd1a
+#    software distributed under the License is distributed on an
52cd1a
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
52cd1a
+#    KIND, either express or implied.  See the License for the
52cd1a
+#    specific language governing permissions and limitations
52cd1a
+#    under the License.
52cd1a
+######################################################################
52cd1a
+
52cd1a
+# General modules
52cd1a
+import os, re, logging
52cd1a
+
52cd1a
+logger = logging.getLogger()
52cd1a
+
52cd1a
+# Our testing module
52cd1a
+import svntest
52cd1a
+
52cd1a
+# (abbreviation)
52cd1a
+Skip = svntest.testcase.Skip_deco
52cd1a
+SkipUnless = svntest.testcase.SkipUnless_deco
52cd1a
+XFail = svntest.testcase.XFail_deco
52cd1a
+Issues = svntest.testcase.Issues_deco
52cd1a
+Issue = svntest.testcase.Issue_deco
52cd1a
+Wimp = svntest.testcase.Wimp_deco
52cd1a
+
52cd1a
+ls_of_D_no_H = '''<html><head><title>repos - Revision 1: /A/D</title></head>
52cd1a
+<body>
52cd1a
+ 

repos - Revision 1: /A/D

52cd1a
+ 
    52cd1a
    +  
  • ..
  • 52cd1a
    +  
  • G/
  • 52cd1a
    +  
  • gamma
  • 52cd1a
    + 
    52cd1a
    +</body></html>'''
    52cd1a
    +
    52cd1a
    +ls_of_D_H = '''<html><head><title>repos - Revision 1: /A/D</title></head>
    52cd1a
    +<body>
    52cd1a
    + 

    repos - Revision 1: /A/D

    52cd1a
    + 
      52cd1a
      +  
    • ..
    • 52cd1a
      +  
    • G/
    • 52cd1a
      +  
    • H/
    • 52cd1a
      +  
    • gamma
    • 52cd1a
      + 
      52cd1a
      +</body></html>'''
      52cd1a
      +
      52cd1a
      +ls_of_H = '''<html><head><title>repos - Revision 1: /A/D/H</title></head>
      52cd1a
      +<body>
      52cd1a
      + 

      repos - Revision 1: /A/D/H

      52cd1a
      + 
        52cd1a
        +  
      • ..
      • 52cd1a
        +  
      • chi
      • 52cd1a
        +  
      • omega
      • 52cd1a
        +  
      • psi
      • 52cd1a
        + 
        52cd1a
        +</body></html>'''
        52cd1a
        +
        52cd1a
        +user1 = svntest.main.wc_author
        52cd1a
        +user1_upper = user1.upper()
        52cd1a
        +user1_pass = svntest.main.wc_passwd
        52cd1a
        +user1_badpass = 'XXX'
        52cd1a
        +assert user1_pass != user1_badpass, "Passwords can't match"
        52cd1a
        +user2 = svntest.main.wc_author2
        52cd1a
        +user2_upper = user2.upper()
        52cd1a
        +user2_pass = svntest.main.wc_passwd
        52cd1a
        +user2_badpass = 'XXX'
        52cd1a
        +assert user2_pass != user2_badpass, "Passwords can't match"
        52cd1a
        +
        52cd1a
        +def write_authz_file(sbox):
        52cd1a
        +    svntest.main.write_authz_file(sbox, {
        52cd1a
        +                                          '/':  '$anonymous = r\n' +
        52cd1a
        +                                                'jrandom = rw\n' +
        52cd1a
        +                                                'jconstant = rw',
        52cd1a
        +                                          '/A/D/H': '$anonymous =\n' +
        52cd1a
        +                                                    '$authenticated =\n' +
        52cd1a
        +                                                    'jrandom = rw'
        52cd1a
        +                                        })
        52cd1a
        +
        52cd1a
        +def write_authz_file_groups(sbox):
        52cd1a
        +    authz_name = sbox.authz_name()
        52cd1a
        +    svntest.main.write_authz_file(sbox,{
        52cd1a
        +                                         '/':  '* =',
        52cd1a
        +                                       })
        52cd1a
        +
        52cd1a
        +def verify_get(test_area_url, path, user, pw,
        52cd1a
        +               expected_status, expected_body, headers):
        52cd1a
        +  import httplib
        52cd1a
        +  from urlparse import urlparse
        52cd1a
        +  import base64
        52cd1a
        +
        52cd1a
        +  req_url = test_area_url + path
        52cd1a
        +
        52cd1a
        +  loc = urlparse(req_url)
        52cd1a
        +
        52cd1a
        +  if loc.scheme == 'http':
        52cd1a
        +    h = httplib.HTTPConnection(loc.hostname, loc.port)
        52cd1a
        +  else:
        52cd1a
        +    h = httplib.HTTPSConnection(loc.hostname, loc.port)
        52cd1a
        +
        52cd1a
        +  if headers is None:
        52cd1a
        +    headers = {}
        52cd1a
        +
        52cd1a
        +  if user and pw:
        52cd1a
        +      auth_info = user + ':' + pw
        52cd1a
        +      headers['Authorization'] = 'Basic ' + base64.b64encode(auth_info)
        52cd1a
        +  else:
        52cd1a
        +      auth_info = "anonymous"
        52cd1a
        +
        52cd1a
        +  h.request('GET', req_url, None, headers)
        52cd1a
        +
        52cd1a
        +  r = h.getresponse()
        52cd1a
        +
        52cd1a
        +  actual_status = r.status
        52cd1a
        +  if expected_status and expected_status != actual_status:
        52cd1a
        +
        52cd1a
        +      logger.warn("Expected status '" + str(expected_status) +
        52cd1a
        +                  "' but got '" + str(actual_status) +
        52cd1a
        +                  "' on url '" + req_url + "' (" +
        52cd1a
        +                  auth_info + ").")
        52cd1a
        +      raise svntest.Failure
        52cd1a
        +
        52cd1a
        +  if expected_body:
        52cd1a
        +      actual_body = r.read()
        52cd1a
        +      if expected_body != actual_body:
        52cd1a
        +        logger.warn("Expected body:")
        52cd1a
        +        logger.warn(expected_body)
        52cd1a
        +        logger.warn("But got:")
        52cd1a
        +        logger.warn(actual_body)
        52cd1a
        +        logger.warn("on url '" + req_url + "' (" + auth_info + ").")
        52cd1a
        +        raise svntest.Failure
        52cd1a
        +
        52cd1a
        +def verify_gets(test_area_url, tests):
        52cd1a
        +  for test in tests:
        52cd1a
        +      verify_get(test_area_url, test['path'], test.get('user'), test.get('pw'),
        52cd1a
        +                 test['status'], test.get('body'), test.get('headers'))
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +######################################################################
        52cd1a
        +# Tests
        52cd1a
        +#
        52cd1a
        +#   Each test must return on success or raise on failure.
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +#----------------------------------------------------------------------
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +def anon(sbox):
        52cd1a
        +  "test anonymous access"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/anon')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  anon_tests = ( 
        52cd1a
        +                 { 'path': '', 'status': 301 },
        52cd1a
        +                 { 'path': '/', 'status': 200 },
        52cd1a
        +                 { 'path': '/repos', 'status': 301 },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200 },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301 },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200 },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301 },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200 },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403 },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403 },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403 },
        52cd1a
        +                 # auth isn't configured so nothing should change when passing
        52cd1a
        +                 # authn details
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +               )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, anon_tests)
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +def mixed(sbox):
        52cd1a
        +  "test mixed anonymous and authenticated access"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/mixed')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  mixed_tests = (
        52cd1a
        +                 { 'path': '', 'status': 301,  },
        52cd1a
        +                 { 'path': '/', 'status': 200,  },
        52cd1a
        +                 { 'path': '/repos', 'status': 301,  },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200,  },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301,  },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200,  },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301,  },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, },
        52cd1a
        +                 # auth is configured and user1 is allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, mixed_tests)
        52cd1a
        +
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +@XFail(svntest.main.is_httpd_authz_provider_enabled)
        52cd1a
        +# uses the AuthzSVNNoAuthWhenAnonymousAllowed On directive
        52cd1a
        +# this is broken with httpd 2.3.x+ since it requires the auth system to accept
        52cd1a
        +# r->user == NULL and there is a test for this in server/request.c now.  It
        52cd1a
        +# was intended as a workaround for the lack of Satisfy Any in 2.3.x+ which
        52cd1a
        +# was resolved by httpd with mod_access_compat in 2.3.x+.
        52cd1a
        +def mixed_noauthwhenanon(sbox):
        52cd1a
        +  "test mixed with noauthwhenanon directive"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/mixed-noauthwhenanon')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  noauthwhenanon_tests = (
        52cd1a
        +                 { 'path': '', 'status': 301,  },
        52cd1a
        +                 { 'path': '/', 'status': 200,  },
        52cd1a
        +                 { 'path': '/repos', 'status': 301,  },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200,  },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301,  },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200,  },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301,  },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, },
        52cd1a
        +                 # auth is configured and user1 is allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 # note that unlike doing this with Satisfy Any this case
        52cd1a
        +                 # actually provides anon access when provided with an invalid
        52cd1a
        +                 # password
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, noauthwhenanon_tests)
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +def authn(sbox):
        52cd1a
        +  "test authenticated only access"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/authn')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  authn_tests = (
        52cd1a
        +                 { 'path': '', 'status': 401,  },
        52cd1a
        +                 { 'path': '/', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, },
        52cd1a
        +                 # auth is configured and user1 is allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 # try with upper case username for user1
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 # try with upper case username for user2
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, authn_tests)
        52cd1a
        +
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +def authn_anonoff(sbox):
        52cd1a
        +  "test authenticated only access with anonoff"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/authn-anonoff')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  anonoff_tests = (
        52cd1a
        +                 { 'path': '', 'status': 401,  },
        52cd1a
        +                 { 'path': '/', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401,  },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, },
        52cd1a
        +                 # auth is configured and user1 is allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 # try with upper case username for user1
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 # try with upper case username for user2
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, anonoff_tests)
        52cd1a
        +
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +def authn_lcuser(sbox):
        52cd1a
        +  "test authenticated only access with lcuser"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/authn-lcuser')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  lcuser_tests = (
        52cd1a
        +                 # try with upper case username for user1 (works due to lcuser option)
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1_upper, 'pw': user1_pass},
        52cd1a
        +                 # try with upper case username for user2 (works due to lcuser option)
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2_upper, 'pw': user2_pass},
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, lcuser_tests)
        52cd1a
        +
        52cd1a
        +# authenticated access only by group - a excuse to use AuthzSVNAuthoritative Off
        52cd1a
        +# this is terribly messed up, Require group runs after mod_authz_svn.
        52cd1a
        +# so if mod_authz_svn grants the access then it doesn't matter what the group
        52cd1a
        +# requirement says.  If we reject the access then you can use the AuthzSVNAuthoritative Off
        52cd1a
        +# directive to fall through to the group check.  Overall the behavior of setups like this
        52cd1a
        +# is almost guaranteed to not be what users expect.
        52cd1a
        +@SkipUnless(svntest.main.is_ra_type_dav)
        52cd1a
        +def authn_group(sbox):
        52cd1a
        +  "test authenticated only access via groups"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/authn-group')
        52cd1a
        +
        52cd1a
        +  # Can't use write_authz_file() as most tests because we want to deny all
        52cd1a
        +  # access with mod_authz_svn so the tests fall through to the group handling
        52cd1a
        +  authz_name = sbox.authz_name()
        52cd1a
        +  svntest.main.write_authz_file(sbox, {
        52cd1a
        +                                        '/':  '* =',
        52cd1a
        +                                      })
        52cd1a
        +
        52cd1a
        +  group_tests = (
        52cd1a
        +                 { 'path': '', 'status': 401, },
        52cd1a
        +                 { 'path': '/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, },
        52cd1a
        +                 # auth is configured and user1 is allowed access repo including H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, group_tests)
        52cd1a
        +
        52cd1a
        +# This test exists to validate our behavior when used with the new authz
        52cd1a
        +# provider system introduced in httpd 2.3.x.  The Satisfy directive
        52cd1a
        +# determines how older authz hooks are combined and the RequireA(ll|ny)
        52cd1a
        +# blocks handles how new authz providers are combined.  The overall results of
        52cd1a
        +# all the authz providers (combined per the Require* blocks) are then
        52cd1a
        +# combined with the other authz hooks via the Satisfy directive.
        52cd1a
        +# Meaning this test requires that mod_authz_svn says yes and there is
        52cd1a
        +# either a valid user or the ALLOW header is 1.  The header may seem
        52cd1a
        +# like a silly test but it's easier to excercise than say a host directive
        52cd1a
        +# in a repeatable test.
        52cd1a
        +@SkipUnless(svntest.main.is_httpd_authz_provider_enabled)
        52cd1a
        +def authn_sallrany(sbox):
        52cd1a
        +  "test satisfy all require any config"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/sallrany')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  allow_header = { 'ALLOW': '1' }
        52cd1a
        +
        52cd1a
        +  sallrany_tests = (
        52cd1a
        +                 #anon access isn't allowed without ALLOW header
        52cd1a
        +                 { 'path': '', 'status': 401, },
        52cd1a
        +                 { 'path': '/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, },
        52cd1a
        +                 # auth is configured and user1 is allowed access repo including H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 # anon is allowed with the ALLOW header
        52cd1a
        +                 { 'path': '', 'status': 301, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 200, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'headers': allow_header },
        52cd1a
        +                 # these 3 tests return 403 instead of 401 becasue the config allows
        52cd1a
        +                 # the anon user with the ALLOW header without any auth and the old hook
        52cd1a
        +                 # system has no way of knowing it should return 401 since authentication is
        52cd1a
        +                 # configured and can change the behavior.  It could decide to return 401 just on
        52cd1a
        +                 # the basis of authentication being configured but then that leaks info in other
        52cd1a
        +                 # cases so it's better for this case to be "broken".
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'headers': allow_header },
        52cd1a
        +                 # auth is configured and user1 is allowed access repo including H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, sallrany_tests)
        52cd1a
        +
        52cd1a
        +# See comments on authn_sallrany test for some background on the interaction
        52cd1a
        +# of Satisfy Any and the newer Require blocks.
        52cd1a
        +@SkipUnless(svntest.main.is_httpd_authz_provider_enabled)
        52cd1a
        +def authn_sallrall(sbox):
        52cd1a
        +  "test satisfy all require all config"
        52cd1a
        +  sbox.build(read_only = True, create_wc = False)
        52cd1a
        +
        52cd1a
        +  test_area_url = sbox.repo_url.replace('/svn-test-work/local_tmp/repos',
        52cd1a
        +                                        '/authz-test-work/sallrall')
        52cd1a
        +
        52cd1a
        +  write_authz_file(sbox)
        52cd1a
        +
        52cd1a
        +  allow_header = { 'ALLOW': '1' }
        52cd1a
        +
        52cd1a
        +  sallrall_tests = (
        52cd1a
        +                 #anon access isn't allowed without ALLOW header
        52cd1a
        +                 { 'path': '', 'status': 403, },
        52cd1a
        +                 { 'path': '/', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, },
        52cd1a
        +                 # auth is configured but no access is allowed without the ALLOW header
        52cd1a
        +                 { 'path': '', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user1, 'pw': user1_pass},
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user1, 'pw': user1_badpass},
        52cd1a
        +                 # auth is configured but no access is allowed without the ALLOW header
        52cd1a
        +                 { 'path': '', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass},
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_badpass},
        52cd1a
        +                 # anon is not allowed even with ALLOW header
        52cd1a
        +                 { 'path': '', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'headers': allow_header },
        52cd1a
        +                 # auth is configured and user1 is allowed access repo including H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_H,
        52cd1a
        +                   'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 301, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 200, 'body': ls_of_H, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 200, 'user': user1, 'pw': user1_pass, 'headers': allow_header },
        52cd1a
        +                 # try with the wrong password for user1
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user1, 'pw': user1_badpass, 'headers': allow_header },
        52cd1a
        +                 # auth is configured and user2 is not allowed access to H
        52cd1a
        +                 { 'path': '', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 301, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 200, 'body': ls_of_D_no_H,
        52cd1a
        +                   'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 200, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 403, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 403, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 403, 'user': user2, 'pw': user2_pass, 'headers': allow_header },
        52cd1a
        +                 # try with the wrong password for user2
        52cd1a
        +                 { 'path': '', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/gamma', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +                 { 'path': '/repos/A/D/H/chi', 'status': 401, 'user': user2, 'pw': user2_badpass, 'headers': allow_header },
        52cd1a
        +
        52cd1a
        +                 )
        52cd1a
        +
        52cd1a
        +  verify_gets(test_area_url, sallrall_tests)
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +########################################################################
        52cd1a
        +# Run the tests
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +# list all tests here, starting with None:
        52cd1a
        +test_list = [ None,
        52cd1a
        +              anon,
        52cd1a
        +              mixed,
        52cd1a
        +              mixed_noauthwhenanon,
        52cd1a
        +              authn,
        52cd1a
        +              authn_anonoff,
        52cd1a
        +              authn_lcuser,
        52cd1a
        +              authn_group,
        52cd1a
        +              authn_sallrany,
        52cd1a
        +              authn_sallrall,
        52cd1a
        +             ]
        52cd1a
        +serial_only = True
        52cd1a
        +
        52cd1a
        +if __name__ == '__main__':
        52cd1a
        +  svntest.main.run_tests(test_list)
        52cd1a
        +  # NOTREACHED
        52cd1a
        +
        52cd1a
        +
        52cd1a
        +### End of file.
        52cd1a
        --- subversion-1.7.14/subversion/tests/cmdline/README.cve3184
        52cd1a
        +++ subversion-1.7.14/subversion/tests/cmdline/README
        52cd1a
        @@ -83,6 +83,133 @@ paths adjusted appropriately:
        52cd1a
              Require valid-user
        52cd1a
            </Location>
        52cd1a
         
        52cd1a
        +   <Location /authz-test-work/anon>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     # This may seem unnecessary but granting access to everyone here is necessary
        52cd1a
        +     # to exercise a bug with httpd 2.3.x+.  The "Require all granted" syntax is
        52cd1a
        +     # new to 2.3.x+ which we can detect with the mod_authz_core.c module
        52cd1a
        +     # signature.  Use the "Allow from all" syntax with older versions for symmetry.
        52cd1a
        +     <IfModule mod_authz_core.c>
        52cd1a
        +       Require all granted
        52cd1a
        +     </IfModule>
        52cd1a
        +     <IfModule !mod_authz_core.c>
        52cd1a
        +       Allow from all
        52cd1a
        +     </IfMOdule>
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/mixed>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     Require           valid-user
        52cd1a
        +     Satisfy Any
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/mixed-noauthwhenanon>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     Require           valid-user
        52cd1a
        +     AuthzSVNNoAuthWhenAnonymousAllowed On
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/authn>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     Require           valid-user
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/authn-anonoff>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     Require           valid-user
        52cd1a
        +     AuthzSVNAnonymous Off
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/authn-lcuser>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     Require           valid-user
        52cd1a
        +     AuthzForceUsernameCase Lower
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/authn-lcuser>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     Require           valid-user
        52cd1a
        +     AuthzForceUsernameCase Lower
        52cd1a
        +   </Location>
        52cd1a
        +   <Location /authz-test-work/authn-group>
        52cd1a
        +     DAV               svn
        52cd1a
        +     SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +     AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +     SVNListParentPath On
        52cd1a
        +     AuthType          Basic
        52cd1a
        +     AuthName          "Subversion Repository"
        52cd1a
        +     AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +     AuthGroupFile /usr/local/apache2/conf/groups
        52cd1a
        +     Require           group random
        52cd1a
        +     AuthzSVNAuthoritative Off
        52cd1a
        +   </Location>
        52cd1a
        +   <IfModule mod_authz_core.c>
        52cd1a
        +     <Location /authz-test-work/sallrany>
        52cd1a
        +       DAV               svn
        52cd1a
        +       SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +       AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +       SVNListParentPath On
        52cd1a
        +       AuthType          Basic
        52cd1a
        +       AuthName          "Subversion Repository"
        52cd1a
        +       AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +       AuthzSendForbiddenOnFailure On
        52cd1a
        +       Satisfy All
        52cd1a
        +       <RequireAny>
        52cd1a
        +         Require valid-user
        52cd1a
        +         Require expr req('ALLOW') == '1'
        52cd1a
        +       </RequireAny>
        52cd1a
        +     </Location>
        52cd1a
        +     <Location /authz-test-work/sallrall>
        52cd1a
        +       DAV               svn
        52cd1a
        +       SVNParentPath /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
        52cd1a
        +       AuthzSVNAccessFile /home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
        52cd1a
        +       SVNListParentPath On
        52cd1a
        +       AuthType          Basic
        52cd1a
        +       AuthName          "Subversion Repository"
        52cd1a
        +       AuthUserFile /usr/local/apache2/conf/users
        52cd1a
        +       AuthzSendForbiddenOnFailure On
        52cd1a
        +       Satisfy All
        52cd1a
        +       <RequireAll>
        52cd1a
        +         Require valid-user
        52cd1a
        +         Require expr req('ALLOW') == '1'
        52cd1a
        +       </RequireAll>
        52cd1a
        +     </Location>
        52cd1a
        +   </IfModule>
        52cd1a
        +
        52cd1a
        +
        52cd1a
            RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)$ /svn-test-work/repositories/$1
        52cd1a
            RedirectMatch           ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)$ /svn-test-work/repositories/$1
        52cd1a
         
        52cd1a
        @@ -101,6 +228,15 @@ just drop the following 2-line snippet i
        52cd1a
         ----------------------------
        52cd1a
         jrandom:xCGl35kV9oWCY
        52cd1a
         jconstant:xCGl35kV9oWCY
        52cd1a
        +JRANDOM:xCGl35kV9oWCY
        52cd1a
        +JCONSTANT:xCGl35kV9oWCY
        52cd1a
        +----------------------------
        52cd1a
        +
        52cd1a
        +and these lines into the
        52cd1a
        +/usr/local/apache/conf/groups file:
        52cd1a
        +----------------------------
        52cd1a
        +random: jrandom
        52cd1a
        +constant: jconstant
        52cd1a
         ----------------------------
        52cd1a
         
        52cd1a
         Now, (re)start Apache and run the tests over mod_dav_svn.
        52cd1a
        @@ -138,6 +274,8 @@ Note [1]: It would be quite too much to
        52cd1a
                   ----------------------------
        52cd1a
                   jrandom:$apr1$3p1.....$FQW6RceW5QhJ2blWDQgKn0
        52cd1a
                   jconstant:$apr1$jp1.....$Usrqji1c9H6AbOxOGAzzb0
        52cd1a
        +          JRANDOM:$apr1$3p1.....$FQW6RceW5QhJ2blWDQgKn0
        52cd1a
        +          JCONSTANT:$apr1$jp1.....$Usrqji1c9H6AbOxOGAzzb0
        52cd1a
                   ----------------------------
        52cd1a
         
        52cd1a
         
        52cd1a
        --- subversion-1.7.14/subversion/tests/cmdline/svntest/main.py.cve3184
        52cd1a
        +++ subversion-1.7.14/subversion/tests/cmdline/svntest/main.py
        52cd1a
        @@ -1148,6 +1148,30 @@ def server_enforces_date_syntax():
        52cd1a
         def server_has_atomic_revprop():
        52cd1a
           return options.server_minor_version >= 7
        52cd1a
         
        52cd1a
        +
        52cd1a
        +# https://issues.apache.org/bugzilla/show_bug.cgi?id=56480
        52cd1a
        +# https://issues.apache.org/bugzilla/show_bug.cgi?id=55397
        52cd1a
        +__mod_dav_url_quoting_broken_versions = frozenset([
        52cd1a
        +    '2.2.27',
        52cd1a
        +    '2.2.26',
        52cd1a
        +    '2.2.25',
        52cd1a
        +    '2.4.9',
        52cd1a
        +    '2.4.8',
        52cd1a
        +    '2.4.7',
        52cd1a
        +    '2.4.6',
        52cd1a
        +    '2.4.5',
        52cd1a
        +])
        52cd1a
        +def is_mod_dav_url_quoting_broken():
        52cd1a
        +    if is_ra_type_dav():
        52cd1a
        +        return (options.httpd_version in __mod_dav_url_quoting_broken_versions)
        52cd1a
        +    return None
        52cd1a
        +
        52cd1a
        +def is_httpd_authz_provider_enabled():
        52cd1a
        +    if is_ra_type_dav():
        52cd1a
        +      v = options.httpd_version.split('.')
        52cd1a
        +      return (v[0] == '2' and int(v[1]) >= 3) or int(v[0]) > 2
        52cd1a
        +    return None
        52cd1a
        +
        52cd1a
         ######################################################################
        52cd1a
         
        52cd1a
         
        52cd1a
        @@ -1194,6 +1218,8 @@ class TestSpawningThread(threading.Threa
        52cd1a
               args.append('--mode-filter=' + options.mode_filter)
        52cd1a
             if options.milestone_filter:
        52cd1a
               args.append('--milestone-filter=' + options.milestone_filter)
        52cd1a
        +    if options.httpd_version:
        52cd1a
        +      args.append('--httpd-version=' + options.httpd_version)
        52cd1a
         
        52cd1a
             result, stdout_lines, stderr_lines = spawn_process(command, 0, 0, None,
        52cd1a
                                                                *args)
        52cd1a
        @@ -1361,6 +1387,36 @@ class TestRunner:
        52cd1a
               sandbox.cleanup_test_paths()
        52cd1a
             return exit_code
        52cd1a
         
        52cd1a
        +
        52cd1a
        +# https://issues.apache.org/bugzilla/show_bug.cgi?id=56480
        52cd1a
        +# https://issues.apache.org/bugzilla/show_bug.cgi?id=55397
        52cd1a
        +__mod_dav_url_quoting_broken_versions = frozenset([
        52cd1a
        +    '2.2.27',
        52cd1a
        +    '2.2.26',
        52cd1a
        +    '2.2.25',
        52cd1a
        +    '2.4.9',
        52cd1a
        +    '2.4.8',
        52cd1a
        +    '2.4.7',
        52cd1a
        +    '2.4.6',
        52cd1a
        +    '2.4.5',
        52cd1a
        +])
        52cd1a
        +def is_mod_dav_url_quoting_broken():
        52cd1a
        +    if is_ra_type_dav():
        52cd1a
        +        return (options.httpd_version in __mod_dav_url_quoting_broken_versions)
        52cd1a
        +    return None
        52cd1a
        +
        52cd1a
        +def is_httpd_authz_provider_enabled():
        52cd1a
        +    if is_ra_type_dav():
        52cd1a
        +      v = options.httpd_version.split('.')
        52cd1a
        +      return (v[0] == '2' and int(v[1]) >= 3) or int(v[0]) > 2
        52cd1a
        +    return None
        52cd1a
        +
        52cd1a
        +def is_httpd_authz_provider_enabled():
        52cd1a
        +    if is_ra_type_dav():
        52cd1a
        +      v = options.httpd_version.split('.')
        52cd1a
        +      return (v[0] == '2' and int(v[1]) >= 3) or int(v[0]) > 2
        52cd1a
        +    return None
        52cd1a
        +
        52cd1a
         ######################################################################
        52cd1a
         # Main testing functions
        52cd1a
         
        52cd1a
        @@ -1526,6 +1582,8 @@ def _create_parser():
        52cd1a
                                  'useful during test development!')
        52cd1a
           parser.add_option('--srcdir', action='store', dest='srcdir',
        52cd1a
                             help='Source directory.')
        52cd1a
        +  parser.add_option('--httpd-version', action='store',
        52cd1a
        +                    help='Assume HTTPD is this version.')
        52cd1a
         
        52cd1a
           # most of the defaults are None, but some are other values, set them here
        52cd1a
           parser.set_defaults(
        52cd1a
        --- subversion-1.7.14/win-tests.py.cve3184
        52cd1a
        +++ subversion-1.7.14/win-tests.py
        52cd1a
        @@ -466,6 +466,7 @@ class Httpd:
        52cd1a
             self.httpd_config = os.path.join(self.root, 'httpd.conf')
        52cd1a
             self.httpd_users = os.path.join(self.root, 'users')
        52cd1a
             self.httpd_mime_types = os.path.join(self.root, 'mime.types')
        52cd1a
        +    self.httpd_groups = os.path.join(self.root, 'groups')
        52cd1a
             self.abs_builddir = abs_builddir
        52cd1a
             self.abs_objdir = abs_objdir
        52cd1a
             self.service_name = 'svn-test-httpd-' + str(httpd_port)
        52cd1a
        @@ -479,6 +480,7 @@ class Httpd:
        52cd1a
             create_target_dir(self.root_dir)
        52cd1a
         
        52cd1a
             self._create_users_file()
        52cd1a
        +    self._create_groups_file()
        52cd1a
             self._create_mime_types_file()
        52cd1a
         
        52cd1a
             # Determine version.
        52cd1a
        @@ -520,6 +522,8 @@ class Httpd:
        52cd1a
             if self.httpd_ver >= 2.2:
        52cd1a
               fp.write(self._sys_module('auth_basic_module', 'mod_auth_basic.so'))
        52cd1a
               fp.write(self._sys_module('authn_file_module', 'mod_authn_file.so'))
        52cd1a
        +      fp.write(self._sys_module('authz_groupfile_module', 'mod_authz_groupfile.so'))
        52cd1a
        +      fp.write(self._sys_module('authz_host_module', 'mod_authz_host.so'))
        52cd1a
             else:
        52cd1a
               fp.write(self._sys_module('auth_module', 'mod_auth.so'))
        52cd1a
             fp.write(self._sys_module('alias_module', 'mod_alias.so'))
        52cd1a
        @@ -533,6 +537,7 @@ class Httpd:
        52cd1a
             # Define two locations for repositories
        52cd1a
             fp.write(self._svn_repo('repositories'))
        52cd1a
             fp.write(self._svn_repo('local_tmp'))
        52cd1a
        +    fp.write(self._svn_authz_repo())
        52cd1a
         
        52cd1a
             # And two redirects for the redirect tests
        52cd1a
             fp.write('RedirectMatch permanent ^/svn-test-work/repositories/'
        52cd1a
        @@ -562,6 +567,17 @@ class Httpd:
        52cd1a
                                             'jrandom', 'rayjandom'])
        52cd1a
             os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-mb',  self.httpd_users,
        52cd1a
                                             'jconstant', 'rayjandom'])
        52cd1a
        +    os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp',  self.httpd_users,
        52cd1a
        +                                    'JRANDOM', 'rayjandom'])
        52cd1a
        +    os.spawnv(os.P_WAIT, htpasswd, ['htpasswd.exe', '-bp',  self.httpd_users,
        52cd1a
        +                                    'JCONSTANT', 'rayjandom'])
        52cd1a
        +
        52cd1a
        +  def _create_groups_file(self):
        52cd1a
        +    "Create groups for mod_authz_svn tests"
        52cd1a
        +    fp = open(self.httpd_groups, 'w')
        52cd1a
        +    fp.write('random: jrandom\n')
        52cd1a
        +    fp.write('constant: jconstant\n')
        52cd1a
        +    fp.close()
        52cd1a
         
        52cd1a
           def _create_mime_types_file(self):
        52cd1a
             "Create empty mime.types file"
        52cd1a
        @@ -595,6 +611,153 @@ class Httpd:
        52cd1a
               '  Require         valid-user\n' \
        52cd1a
               '</Location>\n'
        52cd1a
         
        52cd1a
        +  def _svn_authz_repo(self):
        52cd1a
        +    local_tmp = os.path.join(self.abs_builddir,
        52cd1a
        +                             CMDLINE_TEST_SCRIPT_NATIVE_PATH,
        52cd1a
        +                             'svn-test-work', 'local_tmp')
        52cd1a
        +    return \
        52cd1a
        +      '<Location /authz-test-work/anon>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  <IfModule mod_authz_core.c>' + '\n' \
        52cd1a
        +      '    Require all granted' + '\n' \
        52cd1a
        +      '  </IfModule>' + '\n' \
        52cd1a
        +      '  <IfModule !mod_authz_core.c>' + '\n' \
        52cd1a
        +      '    Allow from all' + '\n' \
        52cd1a
        +      '  </IfModule>' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/mixed>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  Require           valid-user' + '\n' \
        52cd1a
        +      '  Satisfy Any' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/mixed-noauthwhenanon>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  Require           valid-user' + '\n' \
        52cd1a
        +      '  AuthzSVNNoAuthWhenAnonymousAllowed On' + '\n' \
        52cd1a
        +      '  SVNPathAuthz On' + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/authn>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  Require           valid-user' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/authn-anonoff>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  Require           valid-user' + '\n' \
        52cd1a
        +      '  AuthzSVNAnonymous Off' + '\n' \
        52cd1a
        +      '  SVNPathAuthz On' + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/authn-lcuser>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  Require           valid-user' + '\n' \
        52cd1a
        +      '  AuthzForceUsernameCase Lower' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/authn-lcuser>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  Require           valid-user' + '\n' \
        52cd1a
        +      '  AuthzForceUsernameCase Lower' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/authn-group>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  AuthGroupFile    ' + self._quote(self.httpd_groups) + '\n' \
        52cd1a
        +      '  Require           group random' + '\n' \
        52cd1a
        +      '  AuthzSVNAuthoritative Off' + '\n' \
        52cd1a
        +      '  SVNPathAuthz On' + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<IfModule mod_authz_core.c>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/sallrany>' + '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  AuthzSendForbiddenOnFailure On' + '\n' \
        52cd1a
        +      '  Satisfy All' + '\n' \
        52cd1a
        +      '  <RequireAny>' + '\n' \
        52cd1a
        +      '    Require valid-user' + '\n' \
        52cd1a
        +      '    Require expr req(\'ALLOW\') == \'1\'' + '\n' \
        52cd1a
        +      '  </RequireAny>' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '<Location /authz-test-work/sallrall>'+ '\n' \
        52cd1a
        +      '  DAV               svn' + '\n' \
        52cd1a
        +      '  SVNParentPath     ' + local_tmp + '\n' \
        52cd1a
        +      '  AuthzSVNAccessFile ' + self._quote(self.authz_file) + '\n' \
        52cd1a
        +      '  SVNAdvertiseV2Protocol ' + self.httpv2_option + '\n' \
        52cd1a
        +      '  SVNListParentPath On' + '\n' \
        52cd1a
        +      '  AuthType          Basic' + '\n' \
        52cd1a
        +      '  AuthName          "Subversion Repository"' + '\n' \
        52cd1a
        +      '  AuthUserFile    ' + self._quote(self.httpd_users) + '\n' \
        52cd1a
        +      '  AuthzSendForbiddenOnFailure On' + '\n' \
        52cd1a
        +      '  Satisfy All' + '\n' \
        52cd1a
        +      '  <RequireAll>' + '\n' \
        52cd1a
        +      '    Require valid-user' + '\n' \
        52cd1a
        +      '    Require expr req(\'ALLOW\') == \'1\'' + '\n' \
        52cd1a
        +      '  </RequireAll>' + '\n' \
        52cd1a
        +      '  SVNPathAuthz ' + self.path_authz_option + '\n' \
        52cd1a
        +      '</Location>' + '\n' \
        52cd1a
        +      '</IfModule>' + '\n' \
        52cd1a
        +
        52cd1a
           def start(self):
        52cd1a
             if self.service:
        52cd1a
               self._start_service()
        52cd1a
        @@ -728,6 +891,10 @@ if not test_javahl:
        52cd1a
             log_file = os.path.join(abs_builddir, log)
        52cd1a
             fail_log_file = os.path.join(abs_builddir, faillog)
        52cd1a
         
        52cd1a
        +  if run_httpd:
        52cd1a
        +    httpd_version = "%.1f" % daemon.httpd_ver
        52cd1a
        +  else:
        52cd1a
        +    httpd_version = None
        52cd1a
           th = run_tests.TestHarness(abs_srcdir, abs_builddir,
        52cd1a
                                      log_file,
        52cd1a
                                      fail_log_file,
        52cd1a
        @@ -736,7 +903,8 @@ if not test_javahl:
        52cd1a
                                      cleanup, enable_sasl, parallel, config_file,
        52cd1a
                                      fsfs_sharding, fsfs_packing,
        52cd1a
                                      list_tests, svn_bin, mode_filter,
        52cd1a
        -                             milestone_filter)
        52cd1a
        +                             milestone_filter,
        52cd1a
        +                             httpd_version=httpd_version)
        52cd1a
           old_cwd = os.getcwd()
        52cd1a
           try:
        52cd1a
             os.chdir(abs_builddir)