Author: danielsh
Date: Tue Aug 4 10:46:47 2015
New Revision: 1694027
URL: http://svn.apache.org/r1694027
Log:
On the patch-exec branch, sync with trunk.
This picks up r1694026.
Added:
subversion/branches/patch-exec/subversion/tests/cmdline/mod_authz_svn_tests.py
- copied unchanged from r1694026,
subversion/trunk/subversion/tests/cmdline/mod_authz_svn_tests.py
subversion/branches/patch-exec/tools/dist/security/
- copied from r1694026, subversion/trunk/tools/dist/security/
Removed:
subversion/branches/patch-exec/tools/dist/_gnupg.py
Modified:
subversion/branches/patch-exec/ (props changed)
subversion/branches/patch-exec/CHANGES
subversion/branches/patch-exec/build/ac-macros/apache.m4
subversion/branches/patch-exec/subversion/include/svn_client.h
subversion/branches/patch-exec/subversion/libsvn_client/patch.c
subversion/branches/patch-exec/subversion/libsvn_client/resolved.c
subversion/branches/patch-exec/subversion/libsvn_fs_fs/verify.c
subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c
subversion/branches/patch-exec/subversion/libsvn_wc/conflicts.c
subversion/branches/patch-exec/subversion/mod_authz_svn/mod_authz_svn.c
subversion/branches/patch-exec/subversion/svnserve/svnserve.c
subversion/branches/patch-exec/subversion/tests/cmdline/README
subversion/branches/patch-exec/subversion/tests/cmdline/authz_tests.py
subversion/branches/patch-exec/subversion/tests/cmdline/davautocheck.sh
subversion/branches/patch-exec/subversion/tests/cmdline/svnadmin_tests.py
subversion/branches/patch-exec/subversion/tests/cmdline/svntest/main.py
subversion/branches/patch-exec/subversion/tests/libsvn_repos/repos-test.c
subversion/branches/patch-exec/tools/dist/rat-excludes
subversion/branches/patch-exec/tools/dist/release.py
subversion/branches/patch-exec/win-tests.py
Propchange: subversion/branches/patch-exec/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 4 10:46:47 2015
@@ -91,3 +91,4 @@
/subversion/branches/verify-at-commit:1462039-1462408
/subversion/branches/verify-keep-going:1439280-1546110
/subversion/branches/wc-collate-path:1402685-1480384
+/subversion/trunk:1692717-1694026
Modified: subversion/branches/patch-exec/CHANGES
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/CHANGES?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/CHANGES (original)
+++ subversion/branches/patch-exec/CHANGES Tue Aug 4 10:46:47 2015
@@ -1,5 +1,5 @@
Version 1.9.0
-(?? ??? 2015, from /branches/1.9.x)
+(5 Aug 2015, from /branches/1.9.x)
http://svn.apache.org/repos/asf/subversion/tags/1.9.0
User-visible changes:
@@ -452,6 +452,7 @@ http://svn.apache.org/repos/asf/subversi
Developer-visible changes:
- General:
+ * require Python 2.7+ for development and testing (r1691712, r1691713,
r1692448)
* include symbolic names for error codes in maintainer mode (r1467643)
* include symbolic names for warning codes in maintainer mode (r1469855)
* support YouCompleteMe vim plugin (r1476374 et al)
@@ -519,7 +520,7 @@ http://svn.apache.org/repos/asf/subversi
* fix bugs and performance issues using svn_wc_walk_entries3() (r1661110)
* support using Python 3 for building (r1661247)
* don't add -lstdc++ on FreeBSD 10 (r1662329)
- * add build support for Visual Studio 2015 (r1663183, r1663184)
+ * add build support for Visual Studio 2015 (r1663183, r1663184, r1689721
et al.)
* fix test failures when running from a directory whose name contains
characters that must be escaped when used in a URL. (r1664997)
* fix breakage of the serf ra session with svn_ra_get_dir2() and
@@ -733,6 +734,38 @@ http://svn.apache.org/repos/asf/subversi
* javahl: allow compiling with a C++11 compiler (r1684412)
+Version 1.8.14
+(5 Aug 2015, from /branches/1.8.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.8.14
+
+ User-visible changes:
+ - Client-side bugfixes:
+ * document svn:autoprops (r1678494 et al.)
+ * cp: fix 'svn cp ^/A/D/H@1 ^/A' to properly create A (r1674455, r1674456)
+ * resolve: improve conflict prompts for binary files (r1667228 et al.)
+ * ls: improve performance of '-v' on tag directories (r1673153)
+ * improved Sqlite 3.8.9 query performance regression on externals
(r1672295 et al.)
+ * fixed issue #4580: 'svn -v st' on file externals reports "?" instead
+ of user and revision after 'svn up' (r1680242)
+
+ - Server-side bugfixes:
+ * mod_dav_svn: do not ignore skel parsing errors (r1658168)
+ * detect invalid svndiff data earlier (r1684077)
+ * prevent possible repository corruption on power/disk failures (r1680819)
+ * fixed issue #4577: Read error with nodes whose DELTA chain starts with
+ a PLAIN rep (r1676667, r1677267)
+ * fixed issue #4531: server-side copy (over dav) is slow and uses
+ too much memory (r1674627)
+
+ Developer-visible changes:
+ - General:
+ * support building on Windows with Visual Studio 2015 (r1692785)
+ * avoid failing some tests on versions of Python with a very old sqlite
(r1674522)
+ * fix Ruby tests so they don't use the users real configuration (r1597884)
+
+ - Bindings:
+ * swig-pl: fix some stack memory problems (r1668618, 1671388)
+
Version 1.8.13
(31 Mar 2015, from /branches/1.8.x)
http://svn.apache.org/repos/asf/subversion/tags/1.8.13
@@ -1567,6 +1600,26 @@ http://svn.apache.org/repos/asf/subversi
* fix some reference counting bugs in swig-py bindings (r1464899, r1466524)
+Version 1.7.21
+(5 Aug 2015, from /branches/1.7.x)
+http://svn.apache.org/repos/asf/subversion/tags/1.8.21
+
+ User-visible changes:
+ - Client-side bugfixes:
+ * cp: fix 'svn cp ^/A/D/H@1 ^/A' to properly create A (r1674455, r1674456)
+ * fix issue #4551: svnrdump load commits wrong properties, or fails, on a
+ non-deltas dumpfile (r1652182 et al.)
+
+ - Server-side bugfixes:
+ * fix 'svnadmin recover' for pre-1.4 FSFS repositories (r1561419)
+
+ Developer-visible changes:
+ - General:
+ * support building on Windows with Visual Studio 2012, 2013 and 2015
(r1687158, r1692783)
+
+ - Bindings:
+ * swig-pl: fix some stack memory problems (r1668618, 1671388)
+
Version 1.7.20
(31 Mar 2015, from /branches/1.7.x)
http://svn.apache.org/repos/asf/subversion/tags/1.7.20
Modified: subversion/branches/patch-exec/build/ac-macros/apache.m4
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/build/ac-macros/apache.m4?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/build/ac-macros/apache.m4 (original)
+++ subversion/branches/patch-exec/build/ac-macros/apache.m4 Tue Aug 4
10:46:47 2015
@@ -89,6 +89,33 @@ else
AC_MSG_RESULT(no)
fi
+# check for some busted versions of mod_dav
+# in particular 2.2.25, 2.4.5, and 2.4.6 had the following bugs which are
+# troublesome for Subversion:
+# PR 55304: https://issues.apache.org/bugzilla/show_bug.cgi?id=55304
+# PR 55306: https://issues.apache.org/bugzilla/show_bug.cgi?id=55306
+# PR 55397: https://issues.apache.org/bugzilla/show_bug.cgi?id=55397
+if test -n "$APXS" && test "$APXS" != "no"; then
+ AC_MSG_CHECKING([mod_dav version])
+ HTTPD_MAJOR=`$SED -ne '/^#define AP_SERVER_MAJORVERSION_NUMBER/p'
"$APXS_INCLUDE/ap_release.h" | $SED -e 's/^.*NUMBER *//'`
+ HTTPD_MINOR=`$SED -ne '/^#define AP_SERVER_MINORVERSION_NUMBER/p'
"$APXS_INCLUDE/ap_release.h" | $SED -e 's/^.*NUMBER *//'`
+ HTTPD_PATCH=`$SED -ne '/^#define AP_SERVER_PATCHLEVEL_NUMBER/p'
"$APXS_INCLUDE/ap_release.h" | $SED -e 's/^.*NUMBER *//'`
+ HTTPD_VERSION="${HTTPD_MAJOR}.${HTTPD_MINOR}.${HTTPD_PATCH}"
+ case "$HTTPD_VERSION" in
+ 2.2.25 | 2.4.[[5-6]])
+ AC_MSG_RESULT([broken])
+ AC_MSG_ERROR([Apache httpd version $HTTPD_VERSION includes a broken
mod_dav; use a newer version of httpd])
+ ;;
+ 2.[[0-9]]*.[[0-9]]*)
+ AC_MSG_RESULT([acceptable])
+ ;;
+ *)
+ AC_MSG_RESULT([unrecognised])
+ AC_MSG_ERROR([Apache httpd version $HTTPD_VERSION not recognised])
+ ;;
+ esac
+fi
+
if test -n "$APXS" && test "$APXS" != "no"; then
AC_MSG_CHECKING([whether Apache version is compatible with APR version])
apr_major_version="${apr_version%%.*}"
@@ -106,37 +133,15 @@ if test -n "$APXS" && test "$APXS" != "n
AC_MSG_ERROR([unknown APR version])
;;
esac
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
- AC_EGREP_CPP([apache_minor_version= *\"$apache_minor_version_wanted_regex\"],
- [
-#include "$APXS_INCLUDE/ap_release.h"
-apache_minor_version=AP_SERVER_MINORVERSION],
- [AC_MSG_RESULT([yes])],
- [AC_MSG_RESULT([no])
- AC_MSG_ERROR([Apache version incompatible with APR version])])
- CPPFLAGS="$old_CPPFLAGS"
-fi
-
-# check for some busted versions of mod_dav
-# in particular 2.2.25, 2.4.5, and 2.4.6 had the following bugs which are
-# troublesome for Subversion:
-# PR 55304: https://issues.apache.org/bugzilla/show_bug.cgi?id=55304
-# PR 55306: https://issues.apache.org/bugzilla/show_bug.cgi?id=55306
-# PR 55397: https://issues.apache.org/bugzilla/show_bug.cgi?id=55397
-if test -n "$APXS" && test "$APXS" != "no"; then
- AC_MSG_CHECKING([mod_dav version])
- old_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
- blacklisted_versions_regex=["\"2\" \"\.\" (\"2\" \"\.\" \"25\"|\"4\" \"\.\"
\"[56]\")"]
- AC_EGREP_CPP([apache_version= *$blacklisted_versions_regex],
- [
-#include "$APXS_INCLUDE/ap_release.h"
-apache_version=AP_SERVER_BASEREVISION],
- [AC_MSG_RESULT([broken])
- AC_MSG_ERROR([Apache httpd version includes a broken mod_dav;
use a newer version of httpd])],
- [AC_MSG_RESULT([acceptable])])
- CPPFLAGS="$old_CPPFLAGS"
+ case $HTTPD_MINOR in
+ $apache_minor_version_wanted_regex)
+ AC_MSG_RESULT([yes])
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Apache version $HTTPD_VERSION incompatible with APR
version $apr_version])
+ ;;
+ esac
fi
AC_ARG_WITH(apache-libexecdir,
@@ -162,11 +167,15 @@ if test -n "$APXS" && test "$APXS" != "n
BUILD_APACHE_RULE=apache-mod
INSTALL_APACHE_RULE=install-mods-shared
INSTALL_APACHE_MODS=true
- HTTPD="`$APXS -q sbindir`/`$APXS -q PROGNAME`"
- if ! test -e $HTTPD ; then
- HTTPD="`$APXS -q bindir`/`$APXS -q PROGNAME`"
+ AC_ARG_ENABLE(broken-httpd-auth,
+ AS_HELP_STRING([--enable-broken-httpd-auth],
+ [Allow building against httpd 2.4 with broken auth]),
+ [broken_httpd_auth=$enableval],[broken_httpd_auth=no])
+ if test "$enable_broken_httpd_auth" = "yes"; then
+ AC_MSG_NOTICE([Building with broken httpd auth])
+ AC_DEFINE(SVN_ALLOW_BROKEN_HTTPD_AUTH, 1,
+ [Defined to allow building against httpd 2.4 with broken auth])
fi
- HTTPD_VERSION=["`$HTTPD -v | $SED -e 's/^.*\/\([0-9.]*\).*$/\1/' -e 1q`"]
case $host in
*-*-cygwin*)
Modified: subversion/branches/patch-exec/subversion/include/svn_client.h
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/include/svn_client.h?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/include/svn_client.h (original)
+++ subversion/branches/patch-exec/subversion/include/svn_client.h Tue Aug 4
10:46:47 2015
@@ -4361,8 +4361,18 @@ svn_client_revert(const apr_array_header
* @{
*/
+/**
+ * An opaque type which represents a conflicted node in the working copy.
+ *
+ * @since New in 1.10.
+ */
typedef struct svn_client_conflict_t svn_client_conflict_t;
+/**
+ * An opaque type which represents a resolution option for a conflict.
+ *
+ * @since New in 1.10.
+ */
typedef struct svn_client_conflict_option_t svn_client_conflict_option_t;
/**
@@ -4380,13 +4390,43 @@ typedef enum svn_client_conflict_option_
svn_client_conflict_option_working_text,
svn_client_conflict_option_incoming_new_text_for_conflicted_hunks_only,
svn_client_conflict_option_working_text_for_conflicted_hunks_only,
- svn_client_conflict_option_merged_text, /* unsupported */
+ svn_client_conflict_option_merged_text,
svn_client_conflict_option_unspecified
/* Values derived from svn_wc_conflict_choice_t end here. */
} svn_client_conflict_option_id_t;
/**
+ * Set a merged property value on @a option to @a merged_propval.
+ *
+ * Setting the merged value is required before resolving the property
+ * conflict using an option with ID svn_client_conflict_option_merged_text.
+ *
+ * The contents of @a merged_propval are not copied, so the storage it
+ * points to needs to remain valid until svn_client_conflict_prop_resolve()
+ * has been called with @a option.
+ *
+ * @since New in 1.10.
+ */
+void
+svn_client_conflict_option_set_merged_propval(
+ svn_client_conflict_option_t *option,
+ const svn_string_t *merged_propval);
+
+/**
+ * Given an @a option_id, try to find the corresponding option in @a options,
+ * which is an array of svn_client_conflict_option_t * elements.
+ *
+ * Return NULL if no corresponding option can be be found.
+ *
+ * @since New in 1.10.
+ */
+svn_client_conflict_option_t *
+svn_client_conflict_option_find_by_id(
+ apr_array_header_t *options,
+ svn_client_conflict_option_id_t option_id);
+
+/**
* Return a conflict for the conflicted path @a local_abspath.
*
* @since New in 1.10.
@@ -4447,7 +4487,7 @@ svn_client_conflict_walk(const char *loc
* the caller is not interested in the status of a particular type.
*
* The returned @a *props_conflicted array is allocated in @a result_pool.
-* It contains the names of conflicted properties. If no property conflit
+* It contains the names of conflicted properties. If no property conflict
* exists, the array will contain no elements.
*
* @since New in 1.10.
@@ -4525,16 +4565,6 @@ svn_client_conflict_option_describe(cons
apr_pool_t *scratch_pool);
/**
- * Resolve @a conflict using resolution option @a option.
- *
- * @since New in 1.10.
- */
-svn_error_t *
-svn_client_conflict_resolve(svn_client_conflict_t *conflict,
- svn_client_conflict_option_t *option,
- apr_pool_t *scratch_pool);
-
-/**
* Return the kind of conflict (text conflict, property conflict,
* or tree conflict) represented by @a conflict.
*
@@ -4662,6 +4692,40 @@ svn_client_conflict_tree_get_victim_node
const svn_client_conflict_t *conflict);
/**
+ * Resolve a tree @a conflict using resolution option @a option.
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_client_conflict_tree_resolve(svn_client_conflict_t *conflict,
+ svn_client_conflict_option_t *option,
+ apr_pool_t *scratch_pool);
+
+/**
+ * If the provided @a option_id is the ID of an option which resolves
+ * @a conflict, resolve the tree conflict using that option.
+ * Else, return an error.
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_client_conflict_tree_resolve_by_id(
+ svn_client_conflict_t *conflict,
+ svn_client_conflict_option_id_t option_id,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Return the ID of the option this tree @a conflict has been resolved to.
+ * If the conflict has not been resolved yet, then return
+ * @c svn_client_conflict_option_undefined.
+ *
+ * @since New in 1.10.
+ */
+svn_client_conflict_option_id_t
+svn_client_conflict_tree_get_resolution(const svn_client_conflict_t *conflict);
+
+
+/**
* Return the name of the conflicted property represented by @a conflict.
*
* @since New in 1.10.
@@ -4702,6 +4766,44 @@ svn_client_conflict_prop_get_propvals(co
apr_pool_t *result_pool);
/**
+ * Resolve a property @a conflict in property @a propname using resolution
+ * option @a option. To resolve all properties to the same option at once,
+ * set @a propname to the empty string "".
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_client_conflict_prop_resolve(svn_client_conflict_t *conflict,
+ const char *propname,
+ svn_client_conflict_option_t *option,
+ apr_pool_t *scratch_pool);
+/**
+ * If the provided @a option_id is the ID of an option which resolves
+ * @a conflict, resolve the property conflict in property @a propname
+ * using that option. Else, return an error.
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_client_conflict_prop_resolve_by_id(
+ svn_client_conflict_t *conflict,
+ const char *propname,
+ svn_client_conflict_option_id_t option_id,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Return the ID of the option this property @a conflict in property
+ * @a propname has been resolved to.
+ * If the conflict has not been resolved yet, then return
+ * @c svn_client_conflict_option_undefined.
+ *
+ * @since New in 1.10.
+ */
+svn_client_conflict_option_id_t
+svn_client_conflict_prop_get_resolution(const svn_client_conflict_t *conflict,
+ const char *propname);
+
+/**
* Return the MIME-type of the working version of the text-conflicted file
* described by @a conflict.
*
@@ -4729,6 +4831,39 @@ svn_client_conflict_text_get_contents(co
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/**
+ * Resolve a text @a conflict using resolution option @a option.
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_client_conflict_text_resolve(svn_client_conflict_t *conflict,
+ svn_client_conflict_option_t *option,
+ apr_pool_t *scratch_pool);
+
+/**
+ * If the provided @a option_id is the ID of an option which resolves
+ * @a conflict, resolve the text conflict using that option.
+ * Else, return an error.
+ *
+ * @since New in 1.10.
+ */
+svn_error_t *
+svn_client_conflict_text_resolve_by_id(
+ svn_client_conflict_t *conflict,
+ svn_client_conflict_option_id_t option_id,
+ apr_pool_t *scratch_pool);
+
+/**
+ * Return the ID of the option this text @a conflict has been resolved to.
+ * If the conflict has not been resolved yet, then return
+ * @c svn_client_conflict_option_undefined.
+ *
+ * @since New in 1.10.
+ */
+svn_client_conflict_option_id_t
+svn_client_conflict_text_get_resolution(const svn_client_conflict_t *conflict);
+
/** @} */
/**
Modified: subversion/branches/patch-exec/subversion/libsvn_client/patch.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_client/patch.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_client/patch.c Tue Aug 4
10:46:47 2015
@@ -820,22 +820,9 @@ write_file(void *baton, const char *buf,
return SVN_NO_ERROR;
}
-/* Handling symbolic links:
- *
- * In Subversion, symlinks can be represented on disk in two distinct ways.
- * On systems which support symlinks, a symlink is created on disk.
- * On systems which do not support symlink, a file is created on disk
- * which contains the "normal form" of the symlink, which looks like:
- * link TARGET
- * where TARGET is the file the symlink points to.
- *
- * When reading symlinks (i.e. the link itself, not the file the symlink
- * is pointing to) through the svn_subst_create_specialfile() function
- * into a buffer, the buffer always contains the "normal form" of the symlink.
- * Due to this representation symlinks always contain a single line of text.
- *
- * The functions below are needed to deal with the case where a patch
- * wants to change the TARGET that a symlink points to.
+/* Symlinks appear in patches in their repository normal form, abstracted by
+ * the svn_subst_* module. The functions below enable patches to change the
+ * targets of symlinks.
*/
/* Baton for the (readline|tell|seek|write)_symlink functions. */
@@ -871,10 +858,12 @@ readline_symlink(void *baton, svn_string
}
else
{
- svn_string_t *dest;
+ svn_stream_t *stream;
+ const apr_size_t len_hint = 64; /* arbitrary */
- SVN_ERR(svn_io_read_link(&dest, sb->local_abspath, scratch_pool));
- *line = svn_stringbuf_createf(result_pool, "link %s", dest->data);
+ SVN_ERR(svn_subst_read_specialfile(&stream, sb->local_abspath,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stringbuf_from_stream(line, stream, len_hint, result_pool));
sb->at_eof = TRUE;
}
@@ -911,22 +900,17 @@ write_symlink(void *baton, const char *b
apr_pool_t *scratch_pool)
{
const char *target_abspath = baton;
- const char *new_name;
- const char *sym_link = apr_pstrndup(scratch_pool, buf, len);
-
- if (strncmp(sym_link, "link ", 5) != 0)
- return svn_error_create(SVN_ERR_IO_WRITE_ERROR, NULL,
- _("Invalid link representation"));
-
- sym_link += 5; /* Skip "link " */
/* We assume the entire symlink is written at once, as the patch
format is line based */
- SVN_ERR(svn_io_create_unique_link(&new_name, target_abspath, sym_link,
- ".tmp", scratch_pool));
-
- SVN_ERR(svn_io_file_rename(new_name, target_abspath, scratch_pool));
+ {
+ svn_stream_t *stream;
+ SVN_ERR(svn_subst_create_specialfile(&stream, target_abspath,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_write(stream, buf, &len));
+ SVN_ERR(svn_stream_close(stream));
+ }
return SVN_NO_ERROR;
}
Modified: subversion/branches/patch-exec/subversion/libsvn_client/resolved.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_client/resolved.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_client/resolved.c
(original)
+++ subversion/branches/patch-exec/subversion/libsvn_client/resolved.c Tue Aug
4 10:46:47 2015
@@ -157,12 +157,97 @@ struct svn_client_conflict_t
svn_client_ctx_t *ctx;
apr_hash_t *prop_conflicts;
+ /* Indicate which options were chosen to resolve a text or tree conflict
+ * on the conflited node. */
+ svn_client_conflict_option_id_t resolution_text;
+ svn_client_conflict_option_id_t resolution_tree;
+
+ /* A mapping from const char* property name to pointers to
+ * svn_client_conflict_option_t for all properties which had their
+ * conflicts resolved. Indicates which options were chosen to resolve
+ * the property conflicts. */
+ apr_hash_t *resolved_props;
+
/* For backwards compat. */
const svn_wc_conflict_description2_t *legacy_text_conflict;
const svn_wc_conflict_description2_t *legacy_prop_conflict;
const svn_wc_conflict_description2_t *legacy_tree_conflict;
};
+/* Resolves conflict to OPTION and sets CONFLICT->RESOLUTION accordingly. */
+typedef svn_error_t *(*conflict_option_resolve_func_t)(
+ svn_client_conflict_option_t *option,
+ svn_client_conflict_t *conflict,
+ apr_pool_t *scratch_pool);
+
+struct svn_client_conflict_option_t
+{
+ svn_client_conflict_option_id_t id;
+ const char *description;
+
+ svn_client_conflict_t *conflict;
+ conflict_option_resolve_func_t do_resolve_func;
+
+ /* Data which is specific to particular conflicts and options. */
+ union {
+ struct {
+ /* Indicates the property to resolve in case of a property conflict.
+ * If set to "", all properties are resolved to this option. */
+ const char *propname;
+
+ /* A merged property value, if supplied by the API user, else NULL. */
+ const svn_string_t *merged_propval;
+ } prop;
+ } type_data;
+
+};
+
+/*
+ * Return a legacy conflict choice corresponding to OPTION_ID.
+ * Return svn_wc_conflict_choose_undefined if no corresponding
+ * legacy conflict choice exists.
+ */
+static svn_wc_conflict_choice_t
+conflict_option_id_to_wc_conflict_choice(
+ svn_client_conflict_option_id_t option_id)
+{
+
+ switch (option_id)
+ {
+ case svn_client_conflict_option_undefined:
+ return svn_wc_conflict_choose_undefined;
+
+ case svn_client_conflict_option_postpone:
+ return svn_wc_conflict_choose_postpone;
+
+ case svn_client_conflict_option_base_text:
+ return svn_wc_conflict_choose_base;
+
+ case svn_client_conflict_option_incoming_new_text:
+ return svn_wc_conflict_choose_theirs_full;
+
+ case svn_client_conflict_option_working_text:
+ return svn_wc_conflict_choose_mine_full;
+
+ case
svn_client_conflict_option_incoming_new_text_for_conflicted_hunks_only:
+ return svn_wc_conflict_choose_theirs_conflict;
+
+ case svn_client_conflict_option_working_text_for_conflicted_hunks_only:
+ return svn_wc_conflict_choose_mine_conflict;
+
+ case svn_client_conflict_option_merged_text:
+ return svn_wc_conflict_choose_merged;
+
+ case svn_client_conflict_option_unspecified:
+ return svn_wc_conflict_choose_unspecified;
+
+ default:
+ break;
+ }
+
+ return svn_wc_conflict_choose_undefined;
+}
+
static void
add_legacy_desc_to_conflict(const svn_wc_conflict_description2_t *desc,
svn_client_conflict_t *conflict,
@@ -206,12 +291,18 @@ conflict_get_internal(svn_client_conflic
{
/* Add a single legacy conflict descriptor. */
(*conflict)->local_abspath = desc->local_abspath;
+ (*conflict)->resolution_text = svn_client_conflict_option_undefined;
+ (*conflict)->resolution_tree = svn_client_conflict_option_undefined;
+ (*conflict)->resolved_props = apr_hash_make(result_pool);
add_legacy_desc_to_conflict(desc, *conflict, result_pool);
return SVN_NO_ERROR;
}
(*conflict)->local_abspath = apr_pstrdup(result_pool, local_abspath);
+ (*conflict)->resolution_text = svn_client_conflict_option_undefined;
+ (*conflict)->resolution_tree = svn_client_conflict_option_undefined;
+ (*conflict)->resolved_props = apr_hash_make(result_pool);
(*conflict)->ctx = ctx;
/* Add all legacy conflict descriptors we can find. Eventually, this code
@@ -257,37 +348,81 @@ svn_client_conflict_from_wc_description2
result_pool, scratch_pool));
}
-/* Baton type for conflict_walk_status_func(). */
-typedef struct conflict_walk_status_baton_t {
+/* Baton type for conflict_resolver_func(). */
+struct conflict_resolver_baton_t {
svn_client_conflict_walk_func_t *conflict_walk_func;
void *conflict_walk_func_baton;
-
svn_client_ctx_t *ctx;
- int conflicts_found;
-} conflict_walk_status_baton_t;
+} conflict_walk_baton_t;
-/* Implements svn_wc_status_func4_t. */
+/* Implements svn_wc_conflict_resolver_func2_t for now because
+ * libsvn_wc does not support our new conflict type yet. */
static svn_error_t *
-conflict_walk_status_func(void *baton,
- const char *local_abspath,
- const svn_wc_status3_t *status,
- apr_pool_t *scratch_pool)
+conflict_resolver_func(svn_wc_conflict_result_t **result,
+ const svn_wc_conflict_description2_t *description,
+ void *baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
- conflict_walk_status_baton_t *b = baton;
+ struct conflict_resolver_baton_t *b = baton;
svn_client_conflict_t *conflict;
+ const char *local_abspath;
+ svn_client_conflict_option_id_t resolution;
+ svn_wc_conflict_choice_t conflict_choice;
- if (!status->conflicted)
- return SVN_NO_ERROR;
-
- b->conflicts_found++;
-
+ local_abspath = description->local_abspath;
SVN_ERR(svn_client_conflict_get(&conflict, local_abspath, b->ctx,
scratch_pool, scratch_pool));
+
SVN_ERR(b->conflict_walk_func(b->conflict_walk_func_baton,
conflict, scratch_pool));
+ /* Evaluate the conflict callback result based on which kind
+ * of conflict libsvn_wc has given us. */
+ resolution = svn_client_conflict_option_undefined;
+ if (description->kind == svn_wc_conflict_kind_text)
+ resolution = conflict->resolution_text;
+ else if (description->kind == svn_wc_conflict_kind_tree)
+ resolution = conflict->resolution_tree;
+ else if (description->kind == svn_wc_conflict_kind_property)
+ {
+ svn_client_conflict_option_t *option;
+
+ option = svn_hash_gets(conflict->resolved_props,
+ description->property_name);
+ if (option == NULL)
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("No resolution provided for conflicted "
+ "property '%s' on path '%s'"),
+ description->property_name,
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+
+ resolution = svn_client_conflict_option_get_id(option);
+ conflict_choice = conflict_option_id_to_wc_conflict_choice(resolution);
+ *result = svn_wc_create_conflict_result(conflict_choice, NULL,
+ result_pool);
+ if (resolution == svn_client_conflict_option_merged_text)
+ (*result)->merged_value = option->type_data.prop.merged_propval;
+
+ return SVN_NO_ERROR;
+ }
+ else
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("Unknown legacy conflict kind '%d'"),
+ description->kind);
+
+ if (resolution == svn_client_conflict_option_undefined)
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("No resolution for conflicted path '%s'"),
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+
+ conflict_choice = conflict_option_id_to_wc_conflict_choice(resolution);
+ *result = svn_wc_create_conflict_result(conflict_choice, NULL, result_pool);
+
return SVN_NO_ERROR;
}
@@ -299,121 +434,167 @@ svn_client_conflict_walk(const char *loc
svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
{
- conflict_walk_status_baton_t b;
+ struct conflict_resolver_baton_t b;
+ const char *lock_abspath;
+ svn_error_t *err;
b.conflict_walk_func = conflict_walk_func;
b.conflict_walk_func_baton = conflict_walk_func_baton;
b.ctx = ctx;
- /* ### Re-run the status walk until a walk finds no conflicts at all.
- * ### This is a crude implementation but provides the guarantees we offer
- * ### to the caller. To optimize we should check for notifications of new
- * ### conflicts created during the first status walk and then keep invoking
- * ### the callback directly on any new conflicts.
- */
- do
- {
- b.conflicts_found = 0;
- SVN_ERR(svn_wc_walk_status(ctx->wc_ctx, local_abspath, depth,
- FALSE, /* get_all */
- FALSE, /* no_ignore, */
- TRUE, /* ignore_externals */
- NULL, /* ignore_patterns */
- conflict_walk_status_func, &b,
- ctx->cancel_func, ctx->cancel_baton,
- scratch_pool));
- }
- while (b.conflicts_found > 0);
+ SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, ctx->wc_ctx,
+ local_abspath,
+ scratch_pool, scratch_pool));
+ /* ### TODO: svn_wc__resolve_conflicts() should be changed to support
+ * ### iteration without relying on svn_wc_conflict_resolver_func2_t */
+ err = svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
+ depth,
+ TRUE /* resolve_text */,
+ "" /* resolve_prop (ALL props) */,
+ TRUE /* resolve_tree */,
+ svn_wc_conflict_choose_unspecified,
+ conflict_resolver_func, &b,
+ ctx->cancel_func, ctx->cancel_baton,
+ ctx->notify_func2, ctx->notify_baton2,
+ scratch_pool);
+
+ err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
+ lock_abspath,
+
scratch_pool));
+ svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
+
+
return SVN_NO_ERROR;
}
-typedef svn_error_t *(*conflict_option_resolve_func_t)(
+void
+svn_client_conflict_option_set_merged_propval(
svn_client_conflict_option_t *option,
- svn_client_conflict_t *conflict,
- apr_pool_t *scratch_pool);
-
-struct svn_client_conflict_option_t
+ const svn_string_t *merged_propval)
{
- svn_client_conflict_option_id_t id;
- const char *description;
-
- svn_client_conflict_t *conflict;
- conflict_option_resolve_func_t do_resolve_func;
-};
+ option->type_data.prop.merged_propval = merged_propval;
+}
+/*
+ * Resolve the conflict at LOCAL_ABSPATH. Currently only supports
+ * an OPTION_ID which can be mapped to svn_wc_conflict_choice_t and
+ * maps a single option_id to text, prop, and/or tree conflicts.
+ */
static svn_error_t *
-resolve_postpone(svn_client_conflict_option_t *option,
- svn_client_conflict_t *conflict,
+resolve_conflict(svn_client_conflict_option_id_t option_id,
+ const char *local_abspath,
+ svn_boolean_t resolve_text,
+ const char * resolve_prop,
+ svn_boolean_t resolve_tree,
+ svn_client_ctx_t *ctx,
apr_pool_t *scratch_pool)
{
- /* Nothing to do. */
+ svn_wc_conflict_choice_t conflict_choice;
+ const char *lock_abspath;
+ svn_error_t *err;
+
+ conflict_choice = conflict_option_id_to_wc_conflict_choice(option_id);
+ SVN_ERR(svn_wc__acquire_write_lock_for_resolve(&lock_abspath, ctx->wc_ctx,
+ local_abspath,
+ scratch_pool, scratch_pool));
+ err = svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
+ svn_depth_empty,
+ resolve_text, resolve_prop, resolve_tree,
+ conflict_choice,
+ NULL, NULL, /* legacy conflict_func/baton */
+ ctx->cancel_func,
+ ctx->cancel_baton,
+ ctx->notify_func2,
+ ctx->notify_baton2,
+ scratch_pool);
+ err = svn_error_compose_create(err, svn_wc__release_write_lock(ctx->wc_ctx,
+ lock_abspath,
+
scratch_pool));
+ svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
+
return SVN_NO_ERROR;
}
+/* Implements conflict_option_resolve_func_t. */
static svn_error_t *
resolve_text_conflict(svn_client_conflict_option_t *option,
svn_client_conflict_t *conflict,
apr_pool_t *scratch_pool)
{
- svn_client_conflict_option_id_t id;
+ svn_client_conflict_option_id_t option_id;
const char *local_abspath;
- id = svn_client_conflict_option_get_id(option);
+ option_id = svn_client_conflict_option_get_id(option);
local_abspath = svn_client_conflict_get_local_abspath(conflict);
+ SVN_ERR(resolve_conflict(option_id, local_abspath, TRUE, NULL, FALSE,
+ conflict->ctx, scratch_pool));
+ conflict->resolution_text = option_id;
- SVN_ERR(svn_wc_resolved_conflict5(conflict->ctx->wc_ctx, local_abspath,
- svn_depth_empty, TRUE, NULL, FALSE,
- id, /* option id is backwards compatible */
- conflict->ctx->cancel_func,
- conflict->ctx->cancel_baton,
- conflict->ctx->notify_func2,
- conflict->ctx->notify_baton2,
- scratch_pool));
return SVN_NO_ERROR;
}
+/* Implements conflict_option_resolve_func_t. */
static svn_error_t *
resolve_prop_conflict(svn_client_conflict_option_t *option,
svn_client_conflict_t *conflict,
apr_pool_t *scratch_pool)
{
- svn_client_conflict_option_id_t id;
+ svn_client_conflict_option_id_t option_id;
const char *local_abspath;
+ const char *propname = option->type_data.prop.propname;
- id = svn_client_conflict_option_get_id(option);
+ option_id = svn_client_conflict_option_get_id(option);
local_abspath = svn_client_conflict_get_local_abspath(conflict);
+ SVN_ERR(resolve_conflict(option_id, local_abspath,
+ FALSE, propname, FALSE,
+ conflict->ctx, scratch_pool));
+
+ if (propname[0] == '\0')
+ {
+ apr_hash_index_t *hi;
+
+ /* All properties have been resolved to the same option. */
+ for (hi = apr_hash_first(scratch_pool, conflict->prop_conflicts);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ const char *this_propname = apr_hash_this_key(hi);
+
+ svn_hash_sets(conflict->resolved_props,
+
apr_pstrdup(apr_hash_pool_get(conflict->resolved_props),
+ this_propname),
+ option);
+ svn_hash_sets(conflict->prop_conflicts, this_propname, NULL);
+ }
+ }
+ else
+ {
+ svn_hash_sets(conflict->resolved_props,
+ apr_pstrdup(apr_hash_pool_get(conflict->resolved_props),
+ propname),
+ option);
+ svn_hash_sets(conflict->prop_conflicts, propname, NULL);
+ }
- SVN_ERR(svn_wc_resolved_conflict5(conflict->ctx->wc_ctx, local_abspath,
- svn_depth_empty, TRUE, "", FALSE,
- id, /* option id is backwards compatible */
- conflict->ctx->cancel_func,
- conflict->ctx->cancel_baton,
- conflict->ctx->notify_func2,
- conflict->ctx->notify_baton2,
- scratch_pool));
return SVN_NO_ERROR;
}
static svn_error_t *
+/* Implements conflict_option_resolve_func_t. */
resolve_tree_conflict(svn_client_conflict_option_t *option,
svn_client_conflict_t *conflict,
apr_pool_t *scratch_pool)
{
- svn_client_conflict_option_id_t id;
+ svn_client_conflict_option_id_t option_id;
const char *local_abspath;
- id = svn_client_conflict_option_get_id(option);
+ option_id = svn_client_conflict_option_get_id(option);
local_abspath = svn_client_conflict_get_local_abspath(conflict);
+ SVN_ERR(resolve_conflict(option_id, local_abspath, FALSE, NULL, TRUE,
+ conflict->ctx, scratch_pool));
+ conflict->resolution_tree = option_id;
- SVN_ERR(svn_wc_resolved_conflict5(conflict->ctx->wc_ctx, local_abspath,
- svn_depth_empty, FALSE, NULL, TRUE,
- id, /* option id is backwards compatible */
- conflict->ctx->cancel_func,
- conflict->ctx->cancel_baton,
- conflict->ctx->notify_func2,
- conflict->ctx->notify_baton2,
- scratch_pool));
return SVN_NO_ERROR;
}
@@ -424,7 +605,7 @@ static const svn_client_conflict_option_
svn_client_conflict_option_postpone,
N_("mark the conflict to be resolved later"),
NULL,
- resolve_postpone
+ resolve_text_conflict
},
{
@@ -464,7 +645,7 @@ static const svn_client_conflict_option_
svn_client_conflict_option_postpone,
N_("mark the conflict to be resolved later"),
NULL,
- resolve_postpone
+ resolve_text_conflict,
},
{
@@ -490,7 +671,7 @@ static const svn_client_conflict_option_
svn_client_conflict_option_postpone,
N_("mark the conflict to be resolved later"),
NULL,
- resolve_postpone
+ resolve_prop_conflict
},
{
@@ -516,7 +697,7 @@ static const svn_client_conflict_option_
svn_client_conflict_option_postpone,
N_("mark the conflict to be resolved later"),
NULL,
- resolve_postpone
+ resolve_tree_conflict
},
{
@@ -668,15 +849,166 @@ svn_client_conflict_option_describe(cons
}
svn_error_t *
-svn_client_conflict_resolve(svn_client_conflict_t *conflict,
- svn_client_conflict_option_t *option,
- apr_pool_t *scratch_pool)
+svn_client_conflict_text_resolve(svn_client_conflict_t *conflict,
+ svn_client_conflict_option_t *option,
+ apr_pool_t *scratch_pool)
+{
+ SVN_ERR(assert_text_conflict(conflict, scratch_pool));
+ SVN_ERR(option->do_resolve_func(option, conflict, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+svn_client_conflict_option_t *
+svn_client_conflict_option_find_by_id(apr_array_header_t *options,
+ svn_client_conflict_option_id_t
option_id)
+{
+ int i;
+
+ for (i = 0; i < options->nelts; i++)
+ {
+ svn_client_conflict_option_t *this_option;
+ svn_client_conflict_option_id_t this_option_id;
+
+ this_option = APR_ARRAY_IDX(options, i, svn_client_conflict_option_t *);
+ this_option_id = svn_client_conflict_option_get_id(this_option);
+
+ if (this_option_id == option_id)
+ return this_option;
+ }
+
+ return NULL;
+}
+
+svn_error_t *
+svn_client_conflict_text_resolve_by_id(
+ svn_client_conflict_t *conflict,
+ svn_client_conflict_option_id_t option_id,
+ apr_pool_t *scratch_pool)
+{
+ apr_array_header_t *resolution_options;
+ svn_client_conflict_option_t *option;
+
+ SVN_ERR(svn_client_conflict_text_get_resolution_options(
+ &resolution_options, conflict,
+ scratch_pool, scratch_pool));
+ option = svn_client_conflict_option_find_by_id(resolution_options,
+ option_id);
+ if (option == NULL)
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("Inapplicable conflict resolution option "
+ "ID '%d' given for conflicted path '%s'"),
+ option_id,
+ svn_dirent_local_style(conflict->local_abspath,
+ scratch_pool));
+ SVN_ERR(svn_client_conflict_text_resolve(conflict, option, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+svn_client_conflict_option_id_t
+svn_client_conflict_text_get_resolution(const svn_client_conflict_t *conflict)
+{
+ return conflict->resolution_text;
+}
+
+svn_error_t *
+svn_client_conflict_prop_resolve(svn_client_conflict_t *conflict,
+ const char *propname,
+ svn_client_conflict_option_t *option,
+ apr_pool_t *scratch_pool)
+{
+ SVN_ERR(assert_prop_conflict(conflict, scratch_pool));
+ option->type_data.prop.propname = propname;
+ SVN_ERR(option->do_resolve_func(option, conflict, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+svn_error_t *
+svn_client_conflict_prop_resolve_by_id(
+ svn_client_conflict_t *conflict,
+ const char *propname,
+ svn_client_conflict_option_id_t option_id,
+ apr_pool_t *scratch_pool)
{
+ apr_array_header_t *resolution_options;
+ svn_client_conflict_option_t *option;
+
+ SVN_ERR(svn_client_conflict_prop_get_resolution_options(
+ &resolution_options, conflict,
+ scratch_pool, scratch_pool));
+ option = svn_client_conflict_option_find_by_id(resolution_options,
+ option_id);
+ if (option == NULL)
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("Inapplicable conflict resolution option "
+ "ID '%d' given for conflicted path '%s'"),
+ option_id,
+ svn_dirent_local_style(conflict->local_abspath,
+ scratch_pool));
+ SVN_ERR(svn_client_conflict_prop_resolve(conflict, propname, option,
+ scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+svn_client_conflict_option_id_t
+svn_client_conflict_prop_get_resolution(const svn_client_conflict_t *conflict,
+ const char *propname)
+{
+ svn_client_conflict_option_t *option;
+
+ option = svn_hash_gets(conflict->resolved_props, propname);
+ if (option == NULL)
+ return svn_client_conflict_option_undefined;
+
+ return svn_client_conflict_option_get_id(option);
+}
+
+svn_error_t *
+svn_client_conflict_tree_resolve(svn_client_conflict_t *conflict,
+ svn_client_conflict_option_t *option,
+ apr_pool_t *scratch_pool)
+{
+ SVN_ERR(assert_tree_conflict(conflict, scratch_pool));
SVN_ERR(option->do_resolve_func(option, conflict, scratch_pool));
return SVN_NO_ERROR;
}
+svn_error_t *
+svn_client_conflict_tree_resolve_by_id(
+ svn_client_conflict_t *conflict,
+ svn_client_conflict_option_id_t option_id,
+ apr_pool_t *scratch_pool)
+{
+ apr_array_header_t *resolution_options;
+ svn_client_conflict_option_t *option;
+
+ SVN_ERR(svn_client_conflict_tree_get_resolution_options(
+ &resolution_options, conflict,
+ scratch_pool, scratch_pool));
+ option = svn_client_conflict_option_find_by_id(resolution_options,
+ option_id);
+ if (option == NULL)
+ return svn_error_createf(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
+ _("Inapplicable conflict resolution option "
+ "ID '%d' given for conflicted path '%s'"),
+ option_id,
+ svn_dirent_local_style(conflict->local_abspath,
+ scratch_pool));
+ SVN_ERR(svn_client_conflict_tree_resolve(conflict, option, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
+svn_client_conflict_option_id_t
+svn_client_conflict_tree_get_resolution(const svn_client_conflict_t *conflict)
+{
+ return conflict->resolution_tree;
+}
+
/* Return the legacy conflict descriptor which is wrapped by CONFLICT. */
static const svn_wc_conflict_description2_t *
get_conflict_desc2_t(const svn_client_conflict_t *conflict)
@@ -719,9 +1051,11 @@ svn_client_conflict_get_conflicted(svn_b
APR_ARRAY_PUSH((*props_conflicted), const char *) =
conflict->legacy_prop_conflict->property_name;
}
- else
+ else if (conflict->prop_conflicts)
SVN_ERR(svn_hash_keys(props_conflicted, conflict->prop_conflicts,
result_pool));
+ else
+ *props_conflicted = NULL;
}
if (tree_conflicted)
Modified: subversion/branches/patch-exec/subversion/libsvn_fs_fs/verify.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_fs_fs/verify.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_fs_fs/verify.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_fs_fs/verify.c Tue Aug 4
10:46:47 2015
@@ -816,8 +816,15 @@ verify_f7_metadata_consistency(svn_fs_t
/* concurrent packing is one of the reasons why verification may fail.
Make sure, we operate on up-to-date information. */
if (err)
- SVN_ERR(svn_fs_fs__read_min_unpacked_rev(&ffd->min_unpacked_rev,
- fs, pool));
+ {
+ svn_error_t *err2
+ = svn_fs_fs__read_min_unpacked_rev(&ffd->min_unpacked_rev,
+ fs, pool);
+
+ /* Be careful to not leak ERR. */
+ if (err2)
+ return svn_error_trace(svn_error_compose_create(err, err2));
+ }
/* retry the whole shard if it got packed in the meantime */
if (err && count != pack_size(fs, revision))
Modified: subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_repos/rev_hunt.c Tue Aug
4 10:46:47 2015
@@ -710,23 +710,6 @@ svn_repos_trace_node_locations(svn_fs_t
if (! prev_path)
break;
- if (authz_read_func)
- {
- svn_boolean_t readable;
- svn_fs_root_t *tmp_root;
-
- SVN_ERR(svn_fs_revision_root(&tmp_root, fs, revision, currpool));
- SVN_ERR(authz_read_func(&readable, tmp_root, path,
- authz_read_baton, currpool));
- if (! readable)
- {
- svn_pool_destroy(lastpool);
- svn_pool_destroy(currpool);
-
- return SVN_NO_ERROR;
- }
- }
-
/* Assign the current path to all younger revisions until we reach
the copy target rev. */
while ((revision_ptr < revision_ptr_end)
@@ -749,6 +732,20 @@ svn_repos_trace_node_locations(svn_fs_t
path = prev_path;
revision = prev_rev;
+ if (authz_read_func)
+ {
+ svn_boolean_t readable;
+ SVN_ERR(svn_fs_revision_root(&root, fs, revision, currpool));
+ SVN_ERR(authz_read_func(&readable, root, path,
+ authz_read_baton, currpool));
+ if (!readable)
+ {
+ svn_pool_destroy(lastpool);
+ svn_pool_destroy(currpool);
+ return SVN_NO_ERROR;
+ }
+ }
+
/* Clear last pool and switch. */
svn_pool_clear(lastpool);
tmppool = lastpool;
Modified: subversion/branches/patch-exec/subversion/libsvn_wc/conflicts.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/libsvn_wc/conflicts.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/patch-exec/subversion/libsvn_wc/conflicts.c Tue Aug 4
10:46:47 2015
@@ -2589,6 +2589,35 @@ resolve_prop_conflict_on_node(svn_boolea
return SVN_NO_ERROR;
}
+/*
+ * Record a tree conflict resolution failure due to error condition ERR
+ * in the RESOLVE_LATER hash table. If the hash table is not available
+ * (meaning the caller does not wish to retry resolution later), or if
+ * the error condition does not indicate circumstances where another
+ * existing tree conflict is blocking the resolution attempt, then
+ * return the error ERR itself.
+ */
+static svn_error_t *
+handle_tree_conflict_resolution_failure(const char *local_abspath,
+ svn_error_t *err,
+ apr_hash_t *resolve_later)
+{
+ const char *dup_abspath;
+
+ if (!resolve_later
+ || (err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE
+ && err->apr_err != SVN_ERR_WC_FOUND_CONFLICT))
+ return svn_error_trace(err); /* Give up. Do not retry resolution later. */
+
+ svn_error_clear(err);
+ dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
+ local_abspath);
+
+ svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
+
+ return SVN_NO_ERROR; /* Caller may retry after resolving other conflicts. */
+}
+
/*
* Resolve the tree conflict found in DB/LOCAL_ABSPATH according to
* CONFLICT_CHOICE.
@@ -2598,9 +2627,11 @@ resolve_prop_conflict_on_node(svn_boolea
*
* It is not an error if there is no tree conflict.
*
- * If the conflict can't be resolved yet because another tree conflict is
- * blocking a storage location, store the tree conflict in the RESOLVE_LATER
- * hash.
+ * If the conflict can't be resolved yet (e.g. because another tree conflict
+ * is blocking a storage location), and RESOLVE_LATER is not NULL, store the
+ * tree conflict in RESOLVE_LATER and do not mark the conflict resolved.
+ * Else if RESOLVE_LATER is NULL, do not mark the conflict resolved and
+ * return the error which prevented the conflict from being marked resolved.
*/
static svn_error_t *
resolve_tree_conflict_on_node(svn_boolean_t *did_resolve,
@@ -2675,22 +2706,8 @@ resolve_tree_conflict_on_node(svn_boolea
scratch_pool);
if (err)
- {
- const char *dup_abspath;
-
- if (!resolve_later
- || (err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE
- && err->apr_err != SVN_ERR_WC_FOUND_CONFLICT))
- return svn_error_trace(err);
-
- svn_error_clear(err);
- dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
- local_abspath);
-
- svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
-
- return SVN_NO_ERROR; /* Retry after other conflicts */
- }
+ SVN_ERR(handle_tree_conflict_resolution_failure(
+ local_abspath, err, resolve_later));
/* We might now have a moved-away on *this* path, let's
try to resolve that directly if that is the case */
@@ -2757,22 +2774,8 @@ resolve_tree_conflict_on_node(svn_boolea
scratch_pool);
if (err)
- {
- const char *dup_abspath;
-
- if (!resolve_later
- || (err->apr_err != SVN_ERR_WC_OBSTRUCTED_UPDATE
- && err->apr_err != SVN_ERR_WC_FOUND_CONFLICT))
- return svn_error_trace(err);
-
- svn_error_clear(err);
- dup_abspath = apr_pstrdup(apr_hash_pool_get(resolve_later),
- local_abspath);
-
- svn_hash_sets(resolve_later, dup_abspath, dup_abspath);
-
- return SVN_NO_ERROR; /* Retry after other conflicts */
- }
+ SVN_ERR(handle_tree_conflict_resolution_failure(
+ local_abspath, err, resolve_later));
else
*did_resolve = TRUE;
}
Modified:
subversion/branches/patch-exec/subversion/mod_authz_svn/mod_authz_svn.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/mod_authz_svn/mod_authz_svn.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/mod_authz_svn/mod_authz_svn.c
(original)
+++ subversion/branches/patch-exec/subversion/mod_authz_svn/mod_authz_svn.c Tue
Aug 4 10:46:47 2015
@@ -48,6 +48,23 @@
#include "svn_dirent_uri.h"
#include "private/svn_fspath.h"
+/* The apache headers define these and they conflict with our definitions. */
+#ifdef PACKAGE_BUGREPORT
+#undef PACKAGE_BUGREPORT
+#endif
+#ifdef PACKAGE_NAME
+#undef PACKAGE_NAME
+#endif
+#ifdef PACKAGE_STRING
+#undef PACKAGE_STRING
+#endif
+#ifdef PACKAGE_TARNAME
+#undef PACKAGE_TARNAME
+#endif
+#ifdef PACKAGE_VERSION
+#undef PACKAGE_VERSION
+#endif
+#include "svn_private_config.h"
#ifdef APLOG_USE_MODULE
APLOG_USE_MODULE(authz_svn);
@@ -67,6 +84,30 @@ typedef struct authz_svn_config_rec {
const char *force_username_case;
} authz_svn_config_rec;
+#if AP_MODULE_MAGIC_AT_LEAST(20060110,0) /* version where
+ ap_some_auth_required breaks */
+# if AP_MODULE_MAGIC_AT_LEAST(20120211,47) /* first version with
+ force_authn hook and
+ ap_some_authn_required() which
+ allows us to work without
+ ap_some_auth_required() */
+# define USE_FORCE_AUTHN 1
+# define IN_SOME_AUTHN_NOTE "authz_svn-in-some-authn"
+# define FORCE_AUTHN_NOTE "authz_svn-force-authn"
+# else
+ /* ap_some_auth_required() is busted and no viable alternative exists */
+# ifndef SVN_ALLOW_BROKEN_HTTPD_AUTH
+# error This version of httpd has a security hole with mod_authz_svn
+# else
+ /* user wants to build anyway */
+# define USE_FORCE_AUTHN 0
+# endif
+# endif
+#else
+ /* old enough that ap_some_auth_required() still works */
+# define USE_FORCE_AUTHN 0
+#endif
+
/*
* Configuration
*/
@@ -832,6 +873,48 @@ access_checker(request_rec *r)
const char *dest_repos_path = NULL;
int status, authn_required;
+#if USE_FORCE_AUTHN
+ /* Use the force_authn() hook available in 2.4.x to work securely
+ * given that ap_some_auth_required() is no longer functional for our
+ * purposes in 2.4.x.
+ */
+ int authn_configured;
+
+ /* We are not configured to run */
+ if (!conf->anonymous || apr_table_get(r->notes, IN_SOME_AUTHN_NOTE)
+ || (! (conf->access_file || conf->repo_relative_access_file)))
+ return DECLINED;
+
+ /* Authentication is configured */
+ authn_configured = ap_auth_type(r) != NULL;
+ if (authn_configured)
+ {
+ /* If the user is trying to authenticate, let him. It doesn't
+ * make much sense to grant anonymous access but deny authenticated
+ * users access, even though you can do that with '$anon' in the
+ * access file.
+ */
+ if (apr_table_get(r->headers_in,
+ (PROXYREQ_PROXY == r->proxyreq)
+ ? "Proxy-Authorization" : "Authorization"))
+ {
+ /* Set the note to force authn regardless of what access_checker_ex
+ hook requires */
+ apr_table_setn(r->notes, FORCE_AUTHN_NOTE, (const char*)1);
+
+ /* provide the proper return so the access_checker hook doesn't
+ * prevent the code from continuing on to the other auth hooks */
+ if (ap_satisfies(r) != SATISFY_ANY)
+ return OK;
+ else
+ return HTTP_FORBIDDEN;
+ }
+ }
+
+#else
+ /* Support for older versions of httpd that have a working
+ * ap_some_auth_required() */
+
/* We are not configured to run */
if (!conf->anonymous
|| (! (conf->access_file || conf->repo_relative_access_file)))
@@ -846,9 +929,10 @@ access_checker(request_rec *r)
if (ap_satisfies(r) != SATISFY_ANY)
return DECLINED;
- /* If the user is trying to authenticate, let him. If anonymous
- * access is allowed, so is authenticated access, by definition
- * of the meaning of '*' in the access file.
+ /* If the user is trying to authenticate, let him. It doesn't
+ * make much sense to grant anonymous access but deny authenticated
+ * users access, even though you can do that with '$anon' in the
+ * access file.
*/
if (apr_table_get(r->headers_in,
(PROXYREQ_PROXY == r->proxyreq)
@@ -860,6 +944,7 @@ access_checker(request_rec *r)
return HTTP_FORBIDDEN;
}
}
+#endif
/* If anon access is allowed, return OK */
status = req_check_access(r, conf, &repos_path, &dest_repos_path);
@@ -868,7 +953,26 @@ access_checker(request_rec *r)
if (!conf->authoritative)
return DECLINED;
+#if USE_FORCE_AUTHN
+ if (authn_configured) {
+ /* We have to check to see if authn is required because if so we must
+ * return UNAUTHORIZED (401) rather than FORBIDDEN (403) since
returning
+ * the 403 leaks information about what paths may exist to
+ * unauthenticated users. We must set a note here in order
+ * to use ap_some_authn_rquired() without triggering an infinite
+ * loop since the call will trigger this function to be called
again. */
+ apr_table_setn(r->notes, IN_SOME_AUTHN_NOTE, (const char*)1);
+ authn_required = ap_some_authn_required(r);
+ apr_table_unset(r->notes, IN_SOME_AUTHN_NOTE);
+ if (authn_required)
+ {
+ ap_note_auth_failure(r);
+ return HTTP_UNAUTHORIZED;
+ }
+ }
+#else
if (!authn_required)
+#endif
log_access_verdict(APLOG_MARK, r, 0, FALSE, repos_path,
dest_repos_path);
return HTTP_FORBIDDEN;
@@ -949,6 +1053,17 @@ auth_checker(request_rec *r)
return OK;
}
+#if USE_FORCE_AUTHN
+static int
+force_authn(request_rec *r)
+{
+ if (apr_table_get(r->notes, FORCE_AUTHN_NOTE))
+ return OK;
+
+ return DECLINED;
+}
+#endif
+
/*
* Module flesh
*/
@@ -965,6 +1080,9 @@ register_hooks(apr_pool_t *p)
* give SSLOptions +FakeBasicAuth a chance to work. */
ap_hook_check_user_id(check_user_id, mod_ssl, NULL, APR_HOOK_FIRST);
ap_hook_auth_checker(auth_checker, NULL, NULL, APR_HOOK_FIRST);
+#if USE_FORCE_AUTHN
+ ap_hook_force_authn(force_authn, NULL, NULL, APR_HOOK_FIRST);
+#endif
ap_register_provider(p,
AUTHZ_SVN__SUBREQ_BYPASS_PROV_GRP,
AUTHZ_SVN__SUBREQ_BYPASS_PROV_NAME,
Modified: subversion/branches/patch-exec/subversion/svnserve/svnserve.c
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/svnserve/svnserve.c?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/svnserve/svnserve.c (original)
+++ subversion/branches/patch-exec/subversion/svnserve/svnserve.c Tue Aug 4
10:46:47 2015
@@ -320,30 +320,19 @@ static const apr_getopt_option_t svnserv
{"min-threads", SVNSERVE_OPT_MIN_THREADS, 1,
N_("Minimum number of server threads, even if idle.\n"
" "
- "Caped to max-threads; minimum value is 0.\n"
+ "Capped to max-threads; minimum value is 0.\n"
" "
"Default is 1.\n"
" "
"[used only with --threads]")},
-#if (APR_SIZEOF_VOIDP <= 4)
{"max-threads", SVNSERVE_OPT_MAX_THREADS, 1,
N_("Maximum number of server threads, even if there\n"
" "
"are more connections. Minimum value is 1.\n"
" "
- "Default is 64.\n"
+ "Default is " APR_STRINGIFY(THREADPOOL_MAX_SIZE) ".\n"
" "
"[used only with --threads]")},
-#else
- {"max-threads", SVNSERVE_OPT_MAX_THREADS, 1,
- N_("Maximum number of server threads, even if there\n"
- " "
- "are more connections. Minimum value is 1.\n"
- " "
- "Default is 256.\n"
- " "
- "[used only with --threads]")},
-#endif
#endif
{"foreground", SVNSERVE_OPT_FOREGROUND, 0,
N_("run in foreground (useful for debugging)\n"
Modified: subversion/branches/patch-exec/subversion/tests/cmdline/README
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/tests/cmdline/README?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/tests/cmdline/README (original)
+++ subversion/branches/patch-exec/subversion/tests/cmdline/README Tue Aug 4
10:46:47 2015
@@ -83,6 +83,133 @@ paths adjusted appropriately:
Require valid-user
</Location>
+ <Location /authz-test-work/anon>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ # This may seem unnecessary but granting access to everyone here is
necessary
+ # to exercise a bug with httpd 2.3.x+. The "Require all granted" syntax
is
+ # new to 2.3.x+ which we can detect with the mod_authz_core.c module
+ # signature. Use the "Allow from all" syntax with older versions for
symmetry.
+ <IfModule mod_authz_core.c>
+ Require all granted
+ </IfModule>
+ <IfModule !mod_authz_core.c>
+ Allow from all
+ </IfMOdule>
+ </Location>
+ <Location /authz-test-work/mixed>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ Require valid-user
+ Satisfy Any
+ </Location>
+ <Location /authz-test-work/mixed-noauthwhenanon>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ Require valid-user
+ AuthzSVNNoAuthWhenAnonymousAllowed On
+ </Location>
+ <Location /authz-test-work/authn>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ Require valid-user
+ </Location>
+ <Location /authz-test-work/authn-anonoff>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ Require valid-user
+ AuthzSVNAnonymous Off
+ </Location>
+ <Location /authz-test-work/authn-lcuser>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ Require valid-user
+ AuthzForceUsernameCase Lower
+ </Location>
+ <Location /authz-test-work/authn-lcuser>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ Require valid-user
+ AuthzForceUsernameCase Lower
+ </Location>
+ <Location /authz-test-work/authn-group>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ AuthGroupFile /usr/local/apache2/conf/groups
+ Require group random
+ AuthzSVNAuthoritative Off
+ </Location>
+ <IfModule mod_authz_core.c>
+ <Location /authz-test-work/sallrany>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ AuthzSendForbiddenOnFailure On
+ Satisfy All
+ <RequireAny>
+ Require valid-user
+ Require expr req('ALLOW') == '1'
+ </RequireAny>
+ </Location>
+ <Location /authz-test-work/sallrall>
+ DAV svn
+ SVNParentPath
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/local_tmp
+ AuthzSVNAccessFile
/home/yourusernamehere/projects/svn/subversion/tests/cmdline/svn-test-work/authz
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile /usr/local/apache2/conf/users
+ AuthzSendForbiddenOnFailure On
+ Satisfy All
+ <RequireAll>
+ Require valid-user
+ Require expr req('ALLOW') == '1'
+ </RequireAll>
+ </Location>
+ </IfModule>
+
+
RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)$
/svn-test-work/repositories/$1
RedirectMatch ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)$
/svn-test-work/repositories/$1
@@ -101,6 +228,15 @@ just drop the following 2-line snippet i
----------------------------
jrandom:xCGl35kV9oWCY
jconstant:xCGl35kV9oWCY
+JRANDOM:xCGl35kV9oWCY
+JCONSTANT:xCGl35kV9oWCY
+----------------------------
+
+and these lines into the
+/usr/local/apache/conf/groups file:
+----------------------------
+random: jrandom
+constant: jconstant
----------------------------
Now, (re)start Apache and run the tests over mod_dav_svn.
@@ -138,6 +274,8 @@ Note [1]: It would be quite too much to
----------------------------
jrandom:$apr1$3p1.....$FQW6RceW5QhJ2blWDQgKn0
jconstant:$apr1$jp1.....$Usrqji1c9H6AbOxOGAzzb0
+ JRANDOM:$apr1$3p1.....$FQW6RceW5QhJ2blWDQgKn0
+ JCONSTANT:$apr1$jp1.....$Usrqji1c9H6AbOxOGAzzb0
----------------------------
Modified: subversion/branches/patch-exec/subversion/tests/cmdline/authz_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/tests/cmdline/authz_tests.py?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/tests/cmdline/authz_tests.py
(original)
+++ subversion/branches/patch-exec/subversion/tests/cmdline/authz_tests.py Tue
Aug 4 10:46:47 2015
@@ -587,7 +587,10 @@ def authz_log_and_tracing_test(sbox):
## cat
# now see if we can look at the older version of rho
- svntest.actions.run_and_verify_svn(None, expected_err,
+
+ expected_err2 = ".*svn: E195012: Unable to find repository location.*"
+
+ svntest.actions.run_and_verify_svn(None, expected_err2,
'cat', '-r', '2', D_url+'/rho')
if sbox.repo_url.startswith('http'):
@@ -604,10 +607,11 @@ def authz_log_and_tracing_test(sbox):
svntest.actions.run_and_verify_svn(None, expected_err,
'diff', '-r', 'HEAD', G_url+'/rho')
- svntest.actions.run_and_verify_svn(None, expected_err,
+ # diff treats the unreadable path as indicating an add so no error
+ svntest.actions.run_and_verify_svn(None, [],
'diff', '-r', '2', D_url+'/rho')
- svntest.actions.run_and_verify_svn(None, expected_err,
+ svntest.actions.run_and_verify_svn(None, [],
'diff', '-r', '2:4', D_url+'/rho')
# test whether read access is correctly granted and denied
Modified:
subversion/branches/patch-exec/subversion/tests/cmdline/davautocheck.sh
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/tests/cmdline/davautocheck.sh?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/tests/cmdline/davautocheck.sh
(original)
+++ subversion/branches/patch-exec/subversion/tests/cmdline/davautocheck.sh Tue
Aug 4 10:46:47 2015
@@ -296,8 +296,6 @@ LOAD_MOD_AUTHN_CORE="$(get_loadmodule_co
|| fail "Authn_Core module not found."
LOAD_MOD_AUTHZ_CORE="$(get_loadmodule_config mod_authz_core)" \
|| fail "Authz_Core module not found."
-LOAD_MOD_AUTHZ_HOST="$(get_loadmodule_config mod_authz_host)" \
- || fail "Authz_Host module not found."
LOAD_MOD_UNIXD=$(get_loadmodule_config mod_unixd) \
|| fail "UnixD module not found"
}
@@ -305,6 +303,10 @@ LOAD_MOD_AUTHN_FILE="$(get_loadmodule_co
|| fail "Authn_File module not found."
LOAD_MOD_AUTHZ_USER="$(get_loadmodule_config mod_authz_user)" \
|| fail "Authz_User module not found."
+LOAD_MOD_AUTHZ_GROUPFILE="$(get_loadmodule_config mod_authz_groupfile)" \
+ || fail "Authz_GroupFile module not found."
+LOAD_MOD_AUTHZ_HOST="$(get_loadmodule_config mod_authz_host)" \
+ || fail "Authz_Host module not found."
}
if [ ${APACHE_MPM:+set} ]; then
LOAD_MOD_MPM=$(get_loadmodule_config mod_mpm_$APACHE_MPM) \
@@ -347,6 +349,7 @@ else
BASE_URL="$BASE_URL:$HTTPD_PORT"
fi
HTTPD_USERS="$HTTPD_ROOT/users"
+HTTPD_GROUPS="$HTTPD_ROOT/groups"
mkdir "$HTTPD_ROOT" \
|| fail "couldn't create temporary directory '$HTTPD_ROOT'"
@@ -408,6 +411,14 @@ say "Adding users for lock authenticatio
$HTPASSWD -bc $HTTPD_USERS jrandom rayjandom
$HTPASSWD -b $HTTPD_USERS jconstant rayjandom
$HTPASSWD -b $HTTPD_USERS __dumpster__ __loadster__
+$HTPASSWD -b $HTTPD_USERS JRANDOM rayjandom
+$HTPASSWD -b $HTTPD_USERS JCONSTANT rayjandom
+
+say "Adding groups for mod_authz_svn tests"
+cat > "$HTTPD_GROUPS" <<__EOF__
+random: jrandom
+constant: jconstant
+__EOF__
touch $HTTPD_MIME_TYPES
@@ -431,7 +442,9 @@ $LOAD_MOD_AUTHN_CORE
$LOAD_MOD_AUTHN_FILE
$LOAD_MOD_AUTHZ_CORE
$LOAD_MOD_AUTHZ_USER
+$LOAD_MOD_AUTHZ_GROUPFILE
$LOAD_MOD_AUTHZ_HOST
+$LOAD_MOD_ACCESS_COMPAT
LoadModule authz_svn_module "$MOD_AUTHZ_SVN"
LoadModule dontdothat_module "$MOD_DONTDOTHAT"
@@ -537,6 +550,147 @@ CustomLog "$HTTPD_ROOT/ops" "%
SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
${SVN_PATH_AUTHZ_LINE}
</Location>
+<Location /authz-test-work/anon>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ # This may seem unnecessary but granting access to everyone here is necessary
+ # to exercise a bug with httpd 2.3.x+. The "Require all granted" syntax is
+ # new to 2.3.x+ which we can detect with the mod_authz_core.c module
+ # signature. Use the "Allow from all" syntax with older versions for
symmetry.
+ <IfModule mod_authz_core.c>
+ Require all granted
+ </IfModule>
+ <IfModule !mod_authz_core.c>
+ Allow from all
+ </IfModule>
+ ${SVN_PATH_AUTHZ_LINE}
+</Location>
+<Location /authz-test-work/mixed>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
+ Satisfy Any
+ ${SVN_PATH_AUTHZ_LINE}
+</Location>
+<Location /authz-test-work/mixed-noauthwhenanon>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
+ AuthzSVNNoAuthWhenAnonymousAllowed On
+ SVNPathAuthz On
+</Location>
+<Location /authz-test-work/authn>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
+ ${SVN_PATH_AUTHZ_LINE}
+</Location>
+<Location /authz-test-work/authn-anonoff>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
+ AuthzSVNAnonymous Off
+ SVNPathAuthz On
+</Location>
+<Location /authz-test-work/authn-lcuser>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ Require valid-user
+ AuthzForceUsernameCase Lower
+ ${SVN_PATH_AUTHZ_LINE}
+</Location>
+<Location /authz-test-work/authn-group>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ AuthGroupFile $HTTPD_GROUPS
+ Require group random
+ AuthzSVNAuthoritative Off
+ SVNPathAuthz On
+</Location>
+<IfModule mod_authz_core.c>
+ <Location /authz-test-work/sallrany>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ AuthzSendForbiddenOnFailure On
+ Satisfy All
+ <RequireAny>
+ Require valid-user
+ Require expr req('ALLOW') == '1'
+ </RequireAny>
+ ${SVN_PATH_AUTHZ_LINE}
+ </Location>
+ <Location /authz-test-work/sallrall>
+ DAV svn
+ SVNParentPath
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/local_tmp"
+ AuthzSVNAccessFile
"$ABS_BUILDDIR/subversion/tests/cmdline/svn-test-work/authz"
+ SVNAdvertiseV2Protocol ${ADVERTISE_V2_PROTOCOL}
+ SVNCacheRevProps ${CACHE_REVPROPS_SETTING}
+ SVNListParentPath On
+ AuthType Basic
+ AuthName "Subversion Repository"
+ AuthUserFile $HTTPD_USERS
+ AuthzSendForbiddenOnFailure On
+ Satisfy All
+ <RequireAll>
+ Require valid-user
+ Require expr req('ALLOW') == '1'
+ </RequireAll>
+ ${SVN_PATH_AUTHZ_LINE}
+ </Location>
+</IfModule>
RedirectMatch permanent ^/svn-test-work/repositories/REDIRECT-PERM-(.*)\$
/svn-test-work/repositories/\$1
RedirectMatch ^/svn-test-work/repositories/REDIRECT-TEMP-(.*)\$
/svn-test-work/repositories/\$1
__EOF__
Modified:
subversion/branches/patch-exec/subversion/tests/cmdline/svnadmin_tests.py
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/tests/cmdline/svnadmin_tests.py?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/tests/cmdline/svnadmin_tests.py
(original)
+++ subversion/branches/patch-exec/subversion/tests/cmdline/svnadmin_tests.py
Tue Aug 4 10:46:47 2015
@@ -2012,6 +2012,14 @@ def mergeinfo_race(sbox):
"concurrent mergeinfo commits invalidate pred-count"
sbox.build()
+ # This test exercises two commit-time race condition bugs:
+ #
+ # (a) metadata corruption when concurrent commits change svn:mergeinfo
(issue #4129)
+ # (b) false positive SVN_ERR_FS_CONFLICT error with httpv1 commits
+ #
https://mail-archives.apache.org/mod_mbox/subversion-dev/201507.mbox/%[email protected]%3E
+ #
+ # Both bugs are timing-dependent and might not reproduce 100% of the time.
+
wc_dir = sbox.wc_dir
wc2_dir = sbox.add_wc_path('2')
Modified:
subversion/branches/patch-exec/subversion/tests/cmdline/svntest/main.py
URL:
http://svn.apache.org/viewvc/subversion/branches/patch-exec/subversion/tests/cmdline/svntest/main.py?rev=1694027&r1=1694026&r2=1694027&view=diff
==============================================================================
--- subversion/branches/patch-exec/subversion/tests/cmdline/svntest/main.py
(original)
+++ subversion/branches/patch-exec/subversion/tests/cmdline/svntest/main.py Tue
Aug 4 10:46:47 2015
@@ -1545,6 +1545,12 @@ def is_mod_dav_url_quoting_broken():
return (options.httpd_version in __mod_dav_url_quoting_broken_versions)
return None
+def is_httpd_authz_provider_enabled():
+ if is_ra_type_dav():
+ v = options.httpd_version.split('.')
+ return (v[0] == '2' and int(v[1]) >= 3) or int(v[0]) > 2
+ return None
+
######################################################################