subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1245385 [2/5] - in /subversion/branches/1.7.x-r1210147: ./ contrib/server-side/mod_dontdothat/ notes/api-errata/1.7/ subversion/bindings/javahl/src/org/apache/subversion/javahl/ subversion/bindings/javahl/tests/org/apache/subversion/javahl...
Date Fri, 17 Feb 2012 10:52:41 GMT
Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/log.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/log.c Fri Feb 17 10:52:38 2012
@@ -32,6 +32,7 @@
 #include "svn_pools.h"
 #include "svn_ra.h"
 #include "svn_dav.h"
+#include "svn_base64.h"
 #include "svn_xml.h"
 #include "svn_config.h"
 #include "svn_path.h"
@@ -67,9 +68,12 @@ typedef enum log_state_e {
 typedef struct log_info_t {
   apr_pool_t *pool;
 
-  /* The currently collected value as we build it up */
+  /* The currently collected value as we build it up, and its wire
+   * encoding (if any).
+   */
   const char *tmp;
   apr_size_t tmp_len;
+  const char *tmp_encoding;
 
   /* Temporary change path - ultimately inserted into changed_paths hash. */
   svn_log_changed_path2_t *tmp_path;
@@ -114,7 +118,8 @@ typedef struct log_context_t {
 static log_info_t *
 push_state(svn_ra_serf__xml_parser_t *parser,
            log_context_t *log_ctx,
-           log_state_e state)
+           log_state_e state,
+           const char **attrs)
 {
   svn_ra_serf__xml_push_state(parser, state);
 
@@ -152,6 +157,10 @@ push_state(svn_ra_serf__xml_parser_t *pa
     {
       log_info_t *info = parser->state->private;
 
+      info->tmp_encoding = svn_xml_get_attr_value("encoding", attrs);
+      if (info->tmp_encoding)
+        info->tmp_encoding = apr_pstrdup(info->pool, info->tmp_encoding);
+
       if (!info->log_entry->revprops)
         {
           info->log_entry->revprops = apr_hash_make(info->pool);
@@ -192,12 +201,12 @@ start_log(svn_ra_serf__xml_parser_t *par
   if (state == NONE &&
       strcmp(name.name, "log-report") == 0)
     {
-      push_state(parser, log_ctx, REPORT);
+      push_state(parser, log_ctx, REPORT, attrs);
     }
   else if (state == REPORT &&
            strcmp(name.name, "log-item") == 0)
     {
-      push_state(parser, log_ctx, ITEM);
+      push_state(parser, log_ctx, ITEM, attrs);
     }
   else if (state == ITEM)
     {
@@ -205,44 +214,43 @@ start_log(svn_ra_serf__xml_parser_t *par
 
       if (strcmp(name.name, SVN_DAV__VERSION_NAME) == 0)
         {
-          push_state(parser, log_ctx, VERSION);
+          push_state(parser, log_ctx, VERSION, attrs);
         }
       else if (strcmp(name.name, "creator-displayname") == 0)
         {
-          push_state(parser, log_ctx, CREATOR);
+          info = push_state(parser, log_ctx, CREATOR, attrs);
         }
       else if (strcmp(name.name, "date") == 0)
         {
-          push_state(parser, log_ctx, DATE);
+          info = push_state(parser, log_ctx, DATE, attrs);
         }
       else if (strcmp(name.name, "comment") == 0)
         {
-          push_state(parser, log_ctx, COMMENT);
+          info = push_state(parser, log_ctx, COMMENT, attrs);
         }
       else if (strcmp(name.name, "revprop") == 0)
         {
-          const char *revprop_name;
-          info = push_state(parser, log_ctx, REVPROP);
-          revprop_name = svn_xml_get_attr_value("name", attrs);
+          const char *revprop_name =
+            svn_xml_get_attr_value("name", attrs);
           if (revprop_name == NULL)
             return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
                                      _("Missing name attr in revprop element"));
-
+          info = push_state(parser, log_ctx, REVPROP, attrs);
           info->revprop_name = apr_pstrdup(info->pool, revprop_name);
         }
       else if (strcmp(name.name, "has-children") == 0)
         {
-          push_state(parser, log_ctx, HAS_CHILDREN);
+          push_state(parser, log_ctx, HAS_CHILDREN, attrs);
         }
       else if (strcmp(name.name, "subtractive-merge") == 0)
         {
-          push_state(parser, log_ctx, SUBTRACTIVE_MERGE);
+          push_state(parser, log_ctx, SUBTRACTIVE_MERGE, attrs);
         }
       else if (strcmp(name.name, "added-path") == 0)
         {
           const char *copy_path, *copy_rev_str;
 
-          info = push_state(parser, log_ctx, ADDED_PATH);
+          info = push_state(parser, log_ctx, ADDED_PATH, attrs);
           info->tmp_path->action = 'A';
 
           copy_path = svn_xml_get_attr_value("copyfrom-path", attrs);
@@ -266,7 +274,7 @@ start_log(svn_ra_serf__xml_parser_t *par
         {
           const char *copy_path, *copy_rev_str;
 
-          info = push_state(parser, log_ctx, REPLACED_PATH);
+          info = push_state(parser, log_ctx, REPLACED_PATH, attrs);
           info->tmp_path->action = 'R';
 
           copy_path = svn_xml_get_attr_value("copyfrom-path", attrs);
@@ -288,14 +296,14 @@ start_log(svn_ra_serf__xml_parser_t *par
         }
       else if (strcmp(name.name, "deleted-path") == 0)
         {
-          info = push_state(parser, log_ctx, DELETED_PATH);
+          info = push_state(parser, log_ctx, DELETED_PATH, attrs);
           info->tmp_path->action = 'D';
 
           SVN_ERR(read_changed_path_attributes(info->tmp_path, attrs));
         }
       else if (strcmp(name.name, "modified-path") == 0)
         {
-          info = push_state(parser, log_ctx, MODIFIED_PATH);
+          info = push_state(parser, log_ctx, MODIFIED_PATH, attrs);
           info->tmp_path->action = 'M';
 
           SVN_ERR(read_changed_path_attributes(info->tmp_path, attrs));
@@ -305,6 +313,39 @@ start_log(svn_ra_serf__xml_parser_t *par
   return SVN_NO_ERROR;
 }
 
+/*
+ * Set *DECODED_CDATA to a copy of current CDATA being tracked in INFO,
+ * decoded as necessary, and allocated from INFO->pool..
+ */
+static svn_error_t *
+maybe_decode_log_cdata(const svn_string_t **decoded_cdata,
+                       log_info_t *info)
+{
+  if (info->tmp_encoding)
+    {
+      svn_string_t in;
+      in.data = info->tmp;
+      in.len = info->tmp_len;
+
+      /* Check for a known encoding type.  This is easy -- there's
+         only one.  */
+      if (strcmp(info->tmp_encoding, "base64") != 0)
+        {
+          return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                   _("Unsupported encoding '%s'"),
+                                   info->tmp_encoding);
+        }
+
+      *decoded_cdata = svn_base64_decode_string(&in, info->pool);
+    }
+  else
+    {
+      *decoded_cdata = svn_string_ncreate(info->tmp, info->tmp_len,
+                                          info->pool);
+    }
+  return SVN_NO_ERROR;
+}
+
 static svn_error_t *
 end_log(svn_ra_serf__xml_parser_t *parser,
         void *userData,
@@ -361,10 +402,10 @@ end_log(svn_ra_serf__xml_parser_t *parse
     {
       if (log_ctx->want_author)
         {
+          const svn_string_t *decoded_cdata;
+          SVN_ERR(maybe_decode_log_cdata(&decoded_cdata, info));
           apr_hash_set(info->log_entry->revprops, SVN_PROP_REVISION_AUTHOR,
-                       APR_HASH_KEY_STRING,
-                       svn_string_ncreate(info->tmp, info->tmp_len,
-                                          info->pool));
+                       APR_HASH_KEY_STRING, decoded_cdata);
         }
       info->tmp_len = 0;
       svn_ra_serf__xml_pop_state(parser);
@@ -374,10 +415,10 @@ end_log(svn_ra_serf__xml_parser_t *parse
     {
       if (log_ctx->want_date)
         {
+          const svn_string_t *decoded_cdata;
+          SVN_ERR(maybe_decode_log_cdata(&decoded_cdata, info));
           apr_hash_set(info->log_entry->revprops, SVN_PROP_REVISION_DATE,
-                       APR_HASH_KEY_STRING,
-                       svn_string_ncreate(info->tmp, info->tmp_len,
-                                          info->pool));
+                       APR_HASH_KEY_STRING, decoded_cdata);
         }
       info->tmp_len = 0;
       svn_ra_serf__xml_pop_state(parser);
@@ -387,19 +428,20 @@ end_log(svn_ra_serf__xml_parser_t *parse
     {
       if (log_ctx->want_message)
         {
+          const svn_string_t *decoded_cdata;
+          SVN_ERR(maybe_decode_log_cdata(&decoded_cdata, info));
           apr_hash_set(info->log_entry->revprops, SVN_PROP_REVISION_LOG,
-                       APR_HASH_KEY_STRING,
-                       svn_string_ncreate(info->tmp, info->tmp_len,
-                                          info->pool));
+                       APR_HASH_KEY_STRING, decoded_cdata);
         }
       info->tmp_len = 0;
       svn_ra_serf__xml_pop_state(parser);
     }
   else if (state == REVPROP)
     {
+      const svn_string_t *decoded_cdata;
+      SVN_ERR(maybe_decode_log_cdata(&decoded_cdata, info));
       apr_hash_set(info->log_entry->revprops, info->revprop_name,
-                   APR_HASH_KEY_STRING,
-                   svn_string_ncreate(info->tmp, info->tmp_len, info->pool));
+                   APR_HASH_KEY_STRING, decoded_cdata);
       info->tmp_len = 0;
       svn_ra_serf__xml_pop_state(parser);
     }
@@ -562,6 +604,10 @@ create_log_body(serf_bucket_t **body_bkt
         }
     }
 
+  svn_ra_serf__add_tag_buckets(buckets,
+                               "S:encode-binary-props", NULL,
+                               alloc);
+
   svn_ra_serf__add_close_tag_buckets(buckets, alloc,
                                      "S:log-report");
 

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/ra_serf.h?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/ra_serf.h Fri Feb 17 10:52:38 2012
@@ -78,6 +78,7 @@ typedef struct svn_ra_serf__connection_t
 
   /* Are we using ssl */
   svn_boolean_t using_ssl;
+  int server_cert_failures; /* Collected cert failures in chain */
 
   /* Should we ask for compressed responses? */
   svn_boolean_t using_compression;

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/serf.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/serf.c Fri Feb 17 10:52:38 2012
@@ -404,6 +404,7 @@ svn_ra_serf__open(svn_ra_session_t *sess
   serf_sess->conns[0]->last_status_code = -1;
 
   serf_sess->conns[0]->using_ssl = serf_sess->using_ssl;
+  serf_sess->conns[0]->server_cert_failures = 0;
   serf_sess->conns[0]->using_compression = serf_sess->using_compression;
   serf_sess->conns[0]->hostname = url.hostname;
   serf_sess->conns[0]->useragent = NULL;

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/update.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/update.c Fri Feb 17 10:52:38 2012
@@ -1691,7 +1691,9 @@ start_report(svn_ra_serf__xml_parser_t *
         }
       else
         {
-          SVN_ERR_MALFUNCTION();
+          return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                   _("Unknown tag '%s' while at state %d"),
+                                   name.name, state);
         }
 
     }
@@ -1766,7 +1768,9 @@ start_report(svn_ra_serf__xml_parser_t *
         }
       else
         {
-          SVN_ERR_MALFUNCTION();
+          return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
+                                   _("Unknown tag '%s' while at state %d"),
+                                   name.name, state);
         }
     }
   else if (state == IGNORE_PROP_NAME)

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/util.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_serf/util.c Fri Feb 17 10:52:38 2012
@@ -207,6 +207,8 @@ ssl_server_cert(void *baton, int failure
   /* Implicitly approve any non-server certs. */
   if (serf_ssl_cert_depth(cert) > 0)
     {
+      if (failures)
+        conn->server_cert_failures |= ssl_convert_serf_failures(failures);
       return APR_SUCCESS;
     }
 
@@ -231,7 +233,8 @@ ssl_server_cert(void *baton, int failure
   cert_info.issuer_dname = convert_organisation_to_str(issuer, scratch_pool);
   cert_info.ascii_cert = serf_ssl_cert_export(cert, scratch_pool);
 
-  svn_failures = ssl_convert_serf_failures(failures);
+  svn_failures = (ssl_convert_serf_failures(failures)
+                  | conn->server_cert_failures);
 
   /* Try to find matching server name via subjectAltName first... */
   if (san) {

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_svn/cyrus_auth.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_svn/cyrus_auth.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_ra_svn/cyrus_auth.c Fri Feb 17 10:52:38 2012
@@ -169,12 +169,66 @@ apr_status_t svn_ra_svn__sasl_common_ini
   return apr_err;
 }
 
+/* We are going to look at errno when we get SASL_FAIL but we don't
+   know for sure whether SASL always sets errno.  Clearing errno
+   before calling SASL functions helps in cases where SASL does
+   nothing to set errno. */
+#ifdef apr_set_os_error
+#define clear_sasl_errno() apr_set_os_error(APR_SUCCESS)
+#else
+#define clear_sasl_errno() (void)0
+#endif
+
+/* Sometimes SASL returns SASL_FAIL as RESULT and sets errno.
+ * SASL_FAIL translates to "generic error" which is quite unhelpful.
+ * Try to append a more informative error message based on errno so
+ * should be called before doing anything that may change errno. */
+static const char *
+get_sasl_errno_msg(int result, apr_pool_t *result_pool)
+{
+#ifdef apr_get_os_error
+  char buf[1024];
+
+  if (result == SASL_FAIL && apr_get_os_error() != 0)
+    return apr_psprintf(result_pool, ": %s",
+                        svn_strerror(apr_get_os_error(), buf, sizeof(buf)));
+#endif
+  return "";
+}
+
+/* Wrap an error message from SASL with a prefix that allows users
+ * to tell that the error message came from SASL.  Queries errno and
+ * so should be called before doing anything that may change errno. */
+static const char *
+get_sasl_error(sasl_conn_t *sasl_ctx, int result, apr_pool_t *result_pool)
+{
+  const char *sasl_errno_msg = get_sasl_errno_msg(result, result_pool);
+
+  return apr_psprintf(result_pool,
+                      _("SASL authentication error: %s%s"),
+                      sasl_errdetail(sasl_ctx), sasl_errno_msg);
+}
+
 static svn_error_t *sasl_init_cb(void *baton, apr_pool_t *pool)
 {
-  if (svn_ra_svn__sasl_common_init(pool) != APR_SUCCESS
-      || sasl_client_init(NULL) != SASL_OK)
+  int result;
+
+  if (svn_ra_svn__sasl_common_init(pool) != APR_SUCCESS)
     return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
                             _("Could not initialize the SASL library"));
+  clear_sasl_errno();
+  result = sasl_client_init(NULL);
+  if (result != SASL_OK)
+    {
+      const char *sasl_errno_msg = get_sasl_errno_msg(result, pool);
+
+      return svn_error_createf
+        (SVN_ERR_RA_NOT_AUTHORIZED, NULL,
+         _("Could not initialized the SASL library: %s%s"),
+         sasl_errstring(result, NULL, NULL),
+         sasl_errno_msg);
+    }
+
   return SVN_NO_ERROR;
 }
 
@@ -321,16 +375,6 @@ get_password_cb(sasl_conn_t *conn, void 
   return SASL_FAIL;
 }
 
-/* Wrap an error message from SASL with a prefix that allow users
- * to tell that the error message came from SASL. */
-static const char *
-get_sasl_error(sasl_conn_t *sasl_ctx, apr_pool_t *result_pool)
-{
-  return apr_psprintf(result_pool,
-                      _("SASL authentication error: %s"),
-                      sasl_errdetail(sasl_ctx));
-}
-
 /* Create a new SASL context. */
 static svn_error_t *new_sasl_ctx(sasl_conn_t **sasl_ctx,
                                  svn_boolean_t is_tunneled,
@@ -343,14 +387,20 @@ static svn_error_t *new_sasl_ctx(sasl_co
   sasl_security_properties_t secprops;
   int result;
 
+  clear_sasl_errno();
   result = sasl_client_new(SVN_RA_SVN_SASL_NAME,
                            hostname, local_addrport, remote_addrport,
                            callbacks, SASL_SUCCESS_DATA,
                            sasl_ctx);
   if (result != SASL_OK)
-    return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                            sasl_errstring(result, NULL, NULL));
+    {
+      const char *sasl_errno_msg = get_sasl_errno_msg(result, pool);
 
+      return svn_error_createf(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
+                               _("Could not create SASL context: %s%s"),
+                               sasl_errstring(result, NULL, NULL),
+                               sasl_errno_msg);
+    }
   svn_atomic_inc(&sasl_ctx_count);
   apr_pool_cleanup_register(pool, *sasl_ctx, sasl_dispose_cb,
                             apr_pool_cleanup_null);
@@ -361,11 +411,12 @@ static svn_error_t *new_sasl_ctx(sasl_co
          otherwise it will ignore EXTERNAL. The third parameter
          should be the username, but since SASL doesn't seem
          to use it on the client side, any non-empty string will do. */
+      clear_sasl_errno();
       result = sasl_setprop(*sasl_ctx,
                             SASL_AUTH_EXTERNAL, " ");
       if (result != SASL_OK)
         return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                get_sasl_error(*sasl_ctx, pool));
+                                get_sasl_error(*sasl_ctx, result, pool));
     }
 
   /* Set security properties. */
@@ -393,6 +444,7 @@ static svn_error_t *try_auth(svn_ra_svn_
   do
     {
       again = FALSE;
+      clear_sasl_errno();
       result = sasl_client_start(sasl_ctx,
                                  mechstring,
                                  &client_interact,
@@ -411,7 +463,7 @@ static svn_error_t *try_auth(svn_ra_svn_
           case SASL_NOMEM:
             /* Fatal error.  Fail the authentication. */
             return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                    get_sasl_error(sasl_ctx, pool));
+                                    get_sasl_error(sasl_ctx, result, pool));
           default:
             /* For anything else, delete the mech from the list
                and try again. */
@@ -463,6 +515,7 @@ static svn_error_t *try_auth(svn_ra_svn_
       if (strcmp(mech, "CRAM-MD5") != 0)
         in = svn_base64_decode_string(in, pool);
 
+      clear_sasl_errno();
       result = sasl_client_step(sasl_ctx,
                                 in->data,
                                 in->len,
@@ -472,7 +525,7 @@ static svn_error_t *try_auth(svn_ra_svn_
 
       if (result != SASL_OK && result != SASL_CONTINUE)
         return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                get_sasl_error(sasl_ctx, pool));
+                                get_sasl_error(sasl_ctx, result, pool));
 
       /* If the server thinks we're done, then don't send any response. */
       if (strcmp(status, "success") == 0)
@@ -551,12 +604,13 @@ static svn_error_t *sasl_read_cb(void *b
           *len = 0;
           return SVN_NO_ERROR;
         }
+      clear_sasl_errno();
       result = sasl_decode(sasl_baton->ctx, buffer, len2,
                            &sasl_baton->read_buf,
                            &sasl_baton->read_len);
       if (result != SASL_OK)
         return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                get_sasl_error(sasl_baton->ctx,
+                                get_sasl_error(sasl_baton->ctx, result,
                                                sasl_baton->scratch_pool));
     }
 
@@ -592,13 +646,14 @@ sasl_write_cb(void *baton, const char *b
     {
       /* Make sure we don't write too much. */
       *len = (*len > sasl_baton->maxsize) ? sasl_baton->maxsize : *len;
+      clear_sasl_errno();
       result = sasl_encode(sasl_baton->ctx, buffer, *len,
                            &sasl_baton->write_buf,
                            &sasl_baton->write_len);
 
       if (result != SASL_OK)
         return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                get_sasl_error(sasl_baton->ctx,
+                                get_sasl_error(sasl_baton->ctx, result,
                                                sasl_baton->scratch_pool));
     }
 
@@ -652,10 +707,11 @@ svn_error_t *svn_ra_svn__enable_sasl_enc
       int result;
 
       /* Get the strength of the security layer. */
+      clear_sasl_errno();
       result = sasl_getprop(sasl_ctx, SASL_SSF, (void*) &ssfp);
       if (result != SASL_OK)
         return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                get_sasl_error(sasl_ctx, pool));
+                                get_sasl_error(sasl_ctx, result, pool));
 
       if (*ssfp > 0)
         {
@@ -671,23 +727,25 @@ svn_error_t *svn_ra_svn__enable_sasl_enc
           sasl_baton->scratch_pool = conn->pool;
 
           /* Find out the maximum input size for sasl_encode. */
+          clear_sasl_errno();
           result = sasl_getprop(sasl_ctx, SASL_MAXOUTBUF, &maxsize);
           if (result != SASL_OK)
             return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                    get_sasl_error(sasl_ctx, pool));
+                                    get_sasl_error(sasl_ctx, result, pool));
           sasl_baton->maxsize = *((const unsigned int *) maxsize);
 
           /* If there is any data left in the read buffer at this point,
              we need to decrypt it. */
           if (conn->read_end > conn->read_ptr)
             {
+              clear_sasl_errno();
               result = sasl_decode(sasl_ctx, conn->read_ptr,
                                    conn->read_end - conn->read_ptr,
                                    &sasl_baton->read_buf,
                                    &sasl_baton->read_len);
               if (result != SASL_OK)
                 return svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
-                                        get_sasl_error(sasl_ctx, pool));
+                                        get_sasl_error(sasl_ctx, result, pool));
               conn->read_end = conn->read_ptr;
             }
 

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_repos/rev_hunt.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_repos/rev_hunt.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_repos/rev_hunt.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_repos/rev_hunt.c Fri Feb 17 10:52:38 2012
@@ -1258,8 +1258,8 @@ find_merged_revisions(apr_array_header_t
   const apr_array_header_t *old;
   apr_array_header_t *new_merged_path_revs;
   apr_pool_t *iterpool, *last_pool;
-  apr_array_header_t *merged_path_revisions = apr_array_make(pool, 0,
-                                                sizeof(struct path_revision *));
+  apr_array_header_t *merged_path_revisions =
+    apr_array_make(pool, 0, sizeof(struct path_revision *));
 
   old = mainline_path_revisions;
   iterpool = svn_pool_create(pool);

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/dirent_uri.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/dirent_uri.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/dirent_uri.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/dirent_uri.c Fri Feb 17 10:52:38 2012
@@ -2415,10 +2415,10 @@ svn_uri_get_file_url_from_dirent(const c
 #else
   if (dirent[0] == '/')
     {
-      /* Handle UNC paths */
-      assert(dirent[1] != '/'); /* Not absolute! */
+      /* Handle UNC paths //server/share -> file://server/share */
+      assert(dirent[1] == '/'); /* Expect UNC, not non-absolute */
 
-      *url = apr_pstrcat(pool, "file://", dirent+1, NULL);
+      *url = apr_pstrcat(pool, "file:", dirent, NULL);
     }
   else
     *url = apr_pstrcat(pool, "file:///", dirent, NULL);

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/io.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/io.c Fri Feb 17 10:52:38 2012
@@ -3271,6 +3271,15 @@ svn_io_write_unique(const char **tmp_pat
 svn_error_t *
 svn_io_file_trunc(apr_file_t *file, apr_off_t offset, apr_pool_t *pool)
 {
+  /* This is a work-around. APR would flush the write buffer
+     _after_ truncating the file causing now invalid buffered
+     data to be written behind OFFSET. */
+  SVN_ERR(do_io_file_wrapper_cleanup
+    (file, apr_file_flush(file),
+     N_("Can't flush file '%s'"),
+     N_("Can't flush stream"),
+     pool));
+
   return do_io_file_wrapper_cleanup
     (file, apr_file_trunc(file, offset),
      N_("Can't truncate file '%s'"),

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/opt.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/opt.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/opt.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/opt.c Fri Feb 17 10:52:38 2012
@@ -1074,7 +1074,7 @@ svn_opt__print_version_info(const char *
                                      "   compiled %s, %s\n\n"), pgm_name,
                              SVN_VERSION, __DATE__, __TIME__));
   SVN_ERR(svn_cmdline_fputs(
-             _("Copyright (C) 2011 The Apache Software Foundation.\n"
+             _("Copyright (C) 2012 The Apache Software Foundation.\n"
                "This software consists of contributions made by many "
                "people; see the NOTICE\n"
                "file for more information.\n"

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/svn_base64.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/svn_base64.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/svn_base64.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/svn_base64.c Fri Feb 17 10:52:38 2012
@@ -407,10 +407,16 @@ decode_bytes(svn_stringbuf_t *str, const
   signed char find;
   const char *end = data + len;
 
-  /* Resize the stringbuf to make room for the (approximate) size of
-     output, to avoid repeated resizes later.
-     The optimizations in decode_line rely on no resizes being necessary! */
-  svn_stringbuf_ensure(str, str->len + (len / 4) * 3 + 3);
+  /* Resize the stringbuf to make room for the maximum size of output,
+     to avoid repeated resizes later.  The optimizations in
+     decode_line rely on no resizes being necessary!
+
+     (*inbuflen+len) is encoded data length
+     (*inbuflen+len)/4 is the number of complete 4-bytes sets
+     (*inbuflen+len)/4*3 is the number of decoded bytes
+     (*inbuflen+len)/4*3+1 is the number of decoded bytes plus a null
+  */
+  svn_stringbuf_ensure(str, str->len + ((*inbuflen + len) / 4) * 3 + 1);
 
   while ( !*done && p < end )
     {

Propchange: subversion/branches/1.7.x-r1210147/subversion/libsvn_subr/svn_base64.c
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Feb 17 10:52:38 2012
@@ -0,0 +1,80 @@
+/subversion/1.7.x-issue4059/subversion/libsvn_subr/svn_base64.c:1239661-1239744
+/subversion/branches/1.5.x-r30215/subversion/libsvn_subr/svn_base64.c:870312
+/subversion/branches/1.7.x/subversion/libsvn_subr/svn_base64.c:1213306-1245382
+/subversion/branches/1.7.x-JavaHL-pools/subversion/libsvn_subr/svn_base64.c:1158684-1158722
+/subversion/branches/1.7.x-issue3888/subversion/libsvn_subr/svn_base64.c:1148937-1149162
+/subversion/branches/1.7.x-issue3975/subversion/libsvn_subr/svn_base64.c:1160761-1161546
+/subversion/branches/1.7.x-issue3976/subversion/libsvn_subr/svn_base64.c:1161731-1165397
+/subversion/branches/1.7.x-issue4032/subversion/libsvn_subr/svn_base64.c:1186668-1186784
+/subversion/branches/1.7.x-issue4035/subversion/libsvn_subr/svn_base64.c:1186202-1186315
+/subversion/branches/1.7.x-issue4035-r1185738/subversion/libsvn_subr/svn_base64.c:1186316-1186778
+/subversion/branches/1.7.x-issue4059/subversion/libsvn_subr/svn_base64.c:1239745-1242661
+/subversion/branches/1.7.x-issue4093/subversion/libsvn_subr/svn_base64.c:1229839-1230236
+/subversion/branches/1.7.x-issue4k/subversion/libsvn_subr/svn_base64.c:1166502-1167193
+/subversion/branches/1.7.x-neon-default/subversion/libsvn_subr/svn_base64.c:1148803-1158680
+/subversion/branches/1.7.x-r1152189/subversion/libsvn_subr/svn_base64.c:1152759-1154249
+/subversion/branches/1.7.x-r1155160/subversion/libsvn_subr/svn_base64.c:1158704-1159223
+/subversion/branches/1.7.x-r1159093/subversion/libsvn_subr/svn_base64.c:1159097-1159230
+/subversion/branches/1.7.x-r1163557/subversion/libsvn_subr/svn_base64.c:1163574-1170648
+/subversion/branches/1.7.x-r1173425/subversion/libsvn_subr/svn_base64.c:1173429-1176454
+/subversion/branches/1.7.x-r1180154/subversion/libsvn_subr/svn_base64.c:1186224-1186351
+/subversion/branches/1.7.x-r1201824/subversion/libsvn_subr/svn_base64.c:1202121-1207333
+/subversion/branches/1.7.x-r1213331/subversion/libsvn_subr/svn_base64.c:1213684-1213756
+/subversion/branches/1.7.x-r1232221/subversion/libsvn_subr/svn_base64.c:1232358-1238008
+/subversion/branches/1.7.x-r1236343/subversion/libsvn_subr/svn_base64.c:1236628-1239394
+/subversion/branches/1.7.x-svn-patch-eol-fixes/subversion/libsvn_subr/svn_base64.c:1207511-1235924
+/subversion/branches/atomic-revprop/subversion/libsvn_subr/svn_base64.c:965046-1000689
+/subversion/branches/bdb-reverse-deltas/subversion/libsvn_subr/svn_base64.c:872050-872529
+/subversion/branches/diff-callbacks3/subversion/libsvn_subr/svn_base64.c:870059-870761
+/subversion/branches/diff-optimizations/subversion/libsvn_subr/svn_base64.c:1031270-1037352
+/subversion/branches/diff-optimizations-bytes/subversion/libsvn_subr/svn_base64.c:1037353-1067789
+/subversion/branches/dont-save-plaintext-passwords-by-default/subversion/libsvn_subr/svn_base64.c:870728-871118
+/subversion/branches/double-delete/subversion/libsvn_subr/svn_base64.c:870511-872970
+/subversion/branches/explore-wc/subversion/libsvn_subr/svn_base64.c:875486,875493,875497,875507,875511,875514,875559,875580-875581,875584,875587,875611,875627,875647,875667-875668,875711-875712,875733-875734,875736,875744-875748,875751,875758,875782,875795-875796,875830,875836,875838,875842,875852,875855,875864,875870,875873,875880,875885-875888,875890,875897-875898,875905,875907-875909,875935,875943-875944,875946,875979,875982-875983,875985-875986,875990,875997
+/subversion/branches/file-externals/subversion/libsvn_subr/svn_base64.c:871779-873302
+/subversion/branches/fs-rep-sharing/subversion/libsvn_subr/svn_base64.c:869036-873803
+/subversion/branches/fsfs-pack/subversion/libsvn_subr/svn_base64.c:873717-874575
+/subversion/branches/gnome-keyring/subversion/libsvn_subr/svn_base64.c:870558-871410
+/subversion/branches/http-protocol-v2/subversion/libsvn_subr/svn_base64.c:874395-876041
+/subversion/branches/in-memory-cache/subversion/libsvn_subr/svn_base64.c:869829-871452
+/subversion/branches/integrate-cache-item-serialization/subversion/libsvn_subr/svn_base64.c:1068724-1068739
+/subversion/branches/integrate-cache-membuffer/subversion/libsvn_subr/svn_base64.c:998649-998852
+/subversion/branches/integrate-compression-level/subversion/libsvn_subr/svn_base64.c:1068651-1072287
+/subversion/branches/integrate-io-improvements/subversion/libsvn_subr/svn_base64.c:1068684-1072297
+/subversion/branches/integrate-is-cachable/subversion/libsvn_subr/svn_base64.c:1072568-1074082
+/subversion/branches/integrate-partial-getter/subversion/libsvn_subr/svn_base64.c:1072558-1076552
+/subversion/branches/integrate-readline-speedup/subversion/libsvn_subr/svn_base64.c:1072553-1072555
+/subversion/branches/integrate-stream-api-extensions/subversion/libsvn_subr/svn_base64.c:1068695-1072516
+/subversion/branches/integrate-txdelta-caching/subversion/libsvn_subr/svn_base64.c:1072541-1078213
+/subversion/branches/issue-2779-dev/subversion/libsvn_subr/svn_base64.c:965496-984198
+/subversion/branches/issue-2843-dev/subversion/libsvn_subr/svn_base64.c:871432-874179
+/subversion/branches/issue-3000/subversion/libsvn_subr/svn_base64.c:871713,871716-871719,871721-871726,871728,871734
+/subversion/branches/issue-3067-deleted-subtrees/subversion/libsvn_subr/svn_base64.c:873375-874084
+/subversion/branches/issue-3148-dev/subversion/libsvn_subr/svn_base64.c:875193-875204
+/subversion/branches/issue-3220-dev/subversion/libsvn_subr/svn_base64.c:872210-872226
+/subversion/branches/issue-3242-dev/subversion/libsvn_subr/svn_base64.c:879653-896436
+/subversion/branches/issue-3334-dirs/subversion/libsvn_subr/svn_base64.c:875156-875867
+/subversion/branches/issue-3975/subversion/libsvn_subr/svn_base64.c:1152931-1160746
+/subversion/branches/kwallet/subversion/libsvn_subr/svn_base64.c:870785-871314
+/subversion/branches/log-g-performance/subversion/libsvn_subr/svn_base64.c:870941-871032
+/subversion/branches/merge-skips-obstructions/subversion/libsvn_subr/svn_base64.c:874525-874615
+/subversion/branches/nfc-nfd-aware-client/subversion/libsvn_subr/svn_base64.c:870276,870376
+/subversion/branches/performance/subversion/libsvn_subr/svn_base64.c:979193,980118,981087,981090,981189,981194,981287,981684,981827,982043,982355,983398,983406,983430,983474,983488,983490,983760,983764,983766,983770,984927,984973,984984,985014,985037,985046,985472,985477,985482,985487-985488,985493,985497,985500,985514,985601,985603,985606,985669,985695,986453,986465,986485,986491-986492,986517,986521,986605,986608,986817,986832,987865,987868-987869,987872,987886-987888,987893,988319,988898,990330,990533,990535-990537,990541,990568,990572,990574-990575,990600,990759,992899,992904,992911,993127,993141,994956,995478,995507,995603,998012,998858,999098,1001413,1001417,1004291,1022668,1022670,1022676,1022715,1022719,1025660,1025672,1027193,1027203,1027206,1027214,1027227,1028077,1028092,1028094,1028104,1028107,1028111,1028354,1029038,1029042-1029043,1029054-1029055,1029062-1029063,1029078,1029080,1029090,1029092-1029093,1029111,1029151,1029158,1029229-1029230,1029232,1029335-1029
 336,1029339-1029340,1029342,1029344,1030763,1030827,1031203,1031235,1032285,1032333,1033040,1033057,1033294,1035869,1035882,1039511,1043705,1053735,1056015,1066452,1067683,1067697-1078365
+/subversion/branches/py-tests-as-modules/subversion/libsvn_subr/svn_base64.c:956579-1033052
+/subversion/branches/ra_serf-digest-authn/subversion/libsvn_subr/svn_base64.c:875693-876404
+/subversion/branches/reintegrate-improvements/subversion/libsvn_subr/svn_base64.c:873853-874164
+/subversion/branches/revprop-packing/subversion/libsvn_subr/svn_base64.c:1143907,1143971,1143997,1144017,1144499,1144568
+/subversion/branches/subtree-mergeinfo/subversion/libsvn_subr/svn_base64.c:876734-878766
+/subversion/branches/svn-mergeinfo-enhancements/subversion/libsvn_subr/svn_base64.c:870119-870195,870197-870288
+/subversion/branches/svn-patch-improvements/subversion/libsvn_subr/svn_base64.c:918519-934609
+/subversion/branches/svnpatch-diff/subversion/libsvn_subr/svn_base64.c:865738-876477
+/subversion/branches/svnraisetc/subversion/libsvn_subr/svn_base64.c:874709-875149
+/subversion/branches/svnserve-logging/subversion/libsvn_subr/svn_base64.c:869828-870893
+/subversion/branches/tc-issue-3334/subversion/libsvn_subr/svn_base64.c:874697-874773
+/subversion/branches/tc-merge-notify/subversion/libsvn_subr/svn_base64.c:874017-874062
+/subversion/branches/tc-resolve/subversion/libsvn_subr/svn_base64.c:874191-874239
+/subversion/branches/tc_url_rev/subversion/libsvn_subr/svn_base64.c:874351-874483
+/subversion/branches/tree-conflicts/subversion/libsvn_subr/svn_base64.c:868291-873154
+/subversion/branches/tree-conflicts-notify/subversion/libsvn_subr/svn_base64.c:873926-874008
+/subversion/branches/uris-as-urls/subversion/libsvn_subr/svn_base64.c:1060426-1064427
+/subversion/trunk/subversion/libsvn_subr/svn_base64.c:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146762,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147299,1147309,1147882,1148071,1148083,1148094,1148131,1148374,1148424,1148566,1148588,1148652,1148662,1148699,1148853,1148877,1148882,1148936,1149103,1149105,1149135,1149141,1149160,1149228,1149240,1149343,1149371-1149372,1149377,1149398,1149401,1149539,1149572,1149627,1149675,1149701,1149713,1150242,1150254,1150260-1150261,1150266,1150302,1150327,1150344,1150368,1150372,1150441,1150506,1150812,1150853,1151036,1151177,1151610,1151854,1151906,1151911,1152129,1152140,1152189-1152190,1152267,1152282,1152286,1152726,1152809,1153138,1153141,1153416,1153540,1153566,1153799,1153807,1153968,1154009,1154023,1154115,1154119,1154121,1154144,1154155,1154159,1154165,1154215,1154225,1154273,1154278,1154379,1154382,1154461,1154717-1154718,1154733,1154908,1154982,1155015,1155044,1155124,1155131
 ,1155160,1155313,1155334,1155391,1155404,1156085,1156098,1156216,1156218,1156312,1156527,1156717,1156721,1156750,1156827,1156838,1157416,1158187,1158193-1158194,1158196,1158201,1158207,1158209-1158210,1158217,1158285,1158288,1158303,1158309,1158407,1158419,1158421,1158436,1158455,1158616-1158617,1158634,1158854,1158875,1158886,1158893,1158896,1158919,1158923-1158924,1158929,1158963,1159093,1159098,1159101,1159132,1159136,1159148,1159230,1159275,1159400,1159686,1159760,1159772,1160605,1160671,1160682,1160704-1160705,1160756,1161063,1161080,1161185,1161210,1161683,1161721,1162024,1162033,1162201,1162516,1162880,1162974,1162995,1163243,1163372,1163383,1163557,1163792,1163953,1164027,1164386,1164426,1164517,1164535,1164554,1164580,1164614,1164645,1164760,1164765,1166267,1166500,1166555,1166678,1167062,1167173,1167209,1167269,1167503,1167659,1167681,1169524,1169531,1169650,1171708,1173111,1173425,1173639,1174051,1174060,1174652,1174761,1174797-1174798,1174806,1175888,1176915,1176
 949,1177001,1177492,1177732,1178280,1178282,1178942,1179680,1179767,1179776,1180154,1181090,1181110,1181155,1181215,1181609,1181666,1182115,1182527,1182771,1182904,1182909,1183054,1183263,1183347,1185222,1185242,1185280,1185282,1185730,1185738,1185746,1185763,1185768,1185886,1185911,1185918,1186059,1186092,1186101,1186107,1186109,1186121,1186231,1186240,1186422,1186434,1186732,1186755,1186784,1186815,1186928,1186944,1186981,1186983,1187311,1187676,1187695,1188609,1188652,1188677,1188762,1188774,1189190,1189261,1189395,1189580,1189665,1195480,1197135,1197998,1199876,1199950,1200837,1201002,1201072,1201419,1201824,1202132,1202135,1202187,1202333,1202630,1202807,1203546,1203651,1203653,1204167,1204478,1204610,1204673,1205188,1205193,1205209,1205726,1205839,1205848,1206523,1206533,1206576,1206718-1206719,1206724,1206741,1206748,1207555,1207656,1207663,1207808,1207823,1207858,1207949,1208840,1209631,1209654,1210147,1210195,1211483,1211859,1211885,1212476,1212482,1212484,1213331,1
 213673,1213681,1213690,1213711,1213716,1214139,1215260,1215288,1215374-1215375,1215379,1220740,1220742,1220750,1221178,1221303,1221767,1221780,1221793,1222521,1222628,1222644,1222693,1222699,1225491,1226597,1227146,1227237,1227250,1227352,1227372,1227384-1227385,1227900,1228340,1229252,1229303,1229677,1229833,1229980,1230212,1231029,1231944-1231945,1232202,1232207,1232221-1232222,1232413,1235264,1235296,1235302,1235736,1236163,1236173,1236283,1236343,1237720,1239382,1239596,1239631,1239655,1239747,1240314,1240485,1240752,1241530,1241553,1241713,1241726,1242116,1242337,1242537,1242607

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/adm_ops.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/adm_ops.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/adm_ops.c Fri Feb 17 10:52:38 2012
@@ -1277,11 +1277,11 @@ remove_conflict_file(svn_boolean_t *noti
 static int
 compare_revert_list_copied_children(const void *a, const void *b)
 {
-  const svn_wc__db_revert_list_copied_child_info_t *ca = a;
-  const svn_wc__db_revert_list_copied_child_info_t *cb = b;
+  const svn_wc__db_revert_list_copied_child_info_t * const *ca = a;
+  const svn_wc__db_revert_list_copied_child_info_t * const *cb = b;
   int i;
 
-  i = svn_path_compare_paths(ca->abspath, cb->abspath);
+  i = svn_path_compare_paths(ca[0]->abspath, cb[0]->abspath);
 
   /* Reverse the result of svn_path_compare_paths() to achieve
    * descending order. */

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/externals.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/externals.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/externals.c Fri Feb 17 10:52:38 2012
@@ -616,8 +616,13 @@ close_file(void *file_baton,
       {
         new_checksum = eb->original_checksum;
 
-        SVN_ERR(svn_wc__db_base_get_props(&actual_props, eb->db,
-                                          eb->local_abspath, pool, pool));
+        if (eb->had_props)
+          SVN_ERR(svn_wc__db_base_get_props(&base_props, eb->db,
+                                            eb->local_abspath,
+                                            pool, pool));
+
+        SVN_ERR(svn_wc__db_read_props(&actual_props, eb->db,
+                                      eb->local_abspath, pool, pool));
       }
 
     if (!base_props)

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/info.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/info.c Fri Feb 17 10:52:38 2012
@@ -171,7 +171,7 @@ build_info_for_node(svn_wc__info2_t **in
           SVN_ERR(svn_wc__internal_get_origin(NULL, &tmpinfo->rev,
                                               &repos_relpath,
                                               &tmpinfo->repos_root_URL,
-                                              &tmpinfo->repos_UUID,
+                                              &tmpinfo->repos_UUID, NULL,
                                               db, local_abspath, TRUE,
                                               result_pool, scratch_pool));
         }

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/node.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/node.c Fri Feb 17 10:52:38 2012
@@ -1320,6 +1320,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,
@@ -1370,7 +1371,8 @@ svn_wc__internal_get_origin(svn_boolean_
       if (repos_uuid)
         *repos_uuid = original_repos_uuid;
 
-      return SVN_NO_ERROR;
+      if (copy_root_abspath == NULL)
+        return SVN_NO_ERROR;
     }
 
   {
@@ -1399,13 +1401,19 @@ svn_wc__internal_get_origin(svn_boolean_
                                          result_pool, scratch_pool));
 
         if (status == svn_wc__db_status_added)
-          return SVN_NO_ERROR; /* Local addition */
+          {
+            if (is_copy)
+              *is_copy = FALSE;
+            return SVN_NO_ERROR; /* Local addition */
+          }
 
         *repos_relpath = svn_relpath_join(
                                 original_repos_relpath,
                                 svn_dirent_skip_ancestor(op_root_abspath,
                                                          local_abspath),
                                 result_pool);
+        if (copy_root_abspath)
+          *copy_root_abspath = op_root_abspath;
       }
     else /* Deleted, excluded, not-present, server-excluded, ... */
       {
@@ -1430,6 +1438,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
                         const char **repos_relpath,
                         const char **repos_root_url,
                         const char **repos_uuid,
+                        const char **copy_root_abspath,
                         svn_wc_context_t *wc_ctx,
                         const char *local_abspath,
                         svn_boolean_t scan_deleted,
@@ -1438,6 +1447,7 @@ svn_wc__node_get_origin(svn_boolean_t *i
 {
   return svn_error_trace(svn_wc__internal_get_origin(is_copy, revision,
                            repos_relpath, repos_root_url, repos_uuid,
+                           copy_root_abspath,
                            wc_ctx->db, local_abspath, scan_deleted,
                            result_pool, scratch_pool));
 }

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/status.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/status.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/status.c Fri Feb 17 10:52:38 2012
@@ -1424,7 +1424,7 @@ tweak_statushash(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* Returns the URL for DB, or NULL: */
+/* Returns the URL for DB */
 static const char *
 find_dir_repos_relpath(const struct dir_baton *db, apr_pool_t *pool)
 {
@@ -1441,14 +1441,11 @@ find_dir_repos_relpath(const struct dir_
       /* Note that status->repos_relpath could be NULL in the case of a missing
        * directory, which means we need to recurse up another level to get
        * a useful relpath. */
-      if (status)
+      if (status && status->repos_relpath)
         return status->repos_relpath;
 
       repos_relpath = find_dir_repos_relpath(pb, pool);
-      if (repos_relpath)
-        return svn_relpath_join(repos_relpath, db->name, pool);
-      else
-        return NULL;
+      return svn_relpath_join(repos_relpath, db->name, pool);
     }
 }
 
@@ -2144,19 +2141,15 @@ close_file(void *file_baton,
           const char *dir_repos_relpath = find_dir_repos_relpath(fb->dir_baton,
                                                                  pool);
 
-          if (dir_repos_relpath)
-            {
-              /* repos_lock still uses the deprecated filesystem absolute path
-                 format */
-
-              const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
-                                                           fb->name, pool);
-
-              repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
-                                        svn_fspath__join("/", repos_relpath,
-                                                         pool),
-                                        APR_HASH_KEY_STRING);
-            }
+          /* repos_lock still uses the deprecated filesystem absolute path
+             format */
+          const char *repos_relpath = svn_relpath_join(dir_repos_relpath,
+                                                       fb->name, pool);
+
+          repos_lock = apr_hash_get(fb->edit_baton->wb.repos_locks,
+                                    svn_fspath__join("/", repos_relpath,
+                                                     pool),
+                                    APR_HASH_KEY_STRING);
         }
     }
   else
@@ -2363,7 +2356,11 @@ svn_wc__internal_walk_status(svn_wc__db_
 
   err = read_info(&dir_info, local_abspath, db, scratch_pool, scratch_pool);
 
-  if (!err && dir_info->kind == svn_wc__db_kind_dir)
+  if (!err
+      && dir_info->kind == svn_wc__db_kind_dir
+      && dir_info->status != svn_wc__db_status_not_present
+      && dir_info->status != svn_wc__db_status_excluded
+      && dir_info->status != svn_wc__db_status_server_excluded)
     {
       anchor_abspath = local_abspath;
       target_name = NULL;

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc.h?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc.h Fri Feb 17 10:52:38 2012
@@ -622,6 +622,7 @@ svn_wc__internal_get_origin(svn_boolean_
                             const char **repos_relpath,
                             const char **repos_root_url,
                             const char **repos_uuid,
+                            const char **copy_root_abspath,
                             svn_wc__db_t *db,
                             const char *local_abspath,
                             svn_boolean_t scan_deleted,

Modified: subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc_db.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/libsvn_wc/wc_db.c Fri Feb 17 10:52:38 2012
@@ -6762,7 +6762,7 @@ read_children_info(void *baton,
   svn_boolean_t have_row;
   const char *repos_root_url = NULL;
   const char *repos_uuid = NULL;
-  apr_int64_t last_repos_id;
+  apr_int64_t last_repos_id = INVALID_REPOS_ID;
   apr_hash_t *nodes = rci->nodes;
   apr_hash_t *conflicts = rci->conflicts;
   apr_pool_t *result_pool = rci->result_pool;
@@ -6830,20 +6830,36 @@ read_children_info(void *baton,
             }
           else
             {
+              const char *last_repos_root_url = NULL;
+              const char *last_repos_uuid = NULL;
+
               apr_int64_t repos_id = svn_sqlite__column_int64(stmt, 1);
-              if (!repos_root_url)
+              if (!repos_root_url ||
+                  (last_repos_id != INVALID_REPOS_ID &&
+                   repos_id != last_repos_id))
                 {
+                  last_repos_root_url = repos_root_url;
+                  last_repos_uuid = repos_uuid;
                   err = fetch_repos_info(&repos_root_url, &repos_uuid,
                                          wcroot->sdb, repos_id, result_pool);
                   if (err)
                     SVN_ERR(svn_error_compose_create(err,
-                                                     svn_sqlite__reset(stmt)));
-                  last_repos_id = repos_id;
+                                                 svn_sqlite__reset(stmt)));
                 }
 
+              if (last_repos_id == INVALID_REPOS_ID)
+                last_repos_id = repos_id;
+
               /* Assume working copy is all one repos_id so that a
                  single cached value is sufficient. */
-              SVN_ERR_ASSERT(repos_id == last_repos_id);
+              if (repos_id != last_repos_id)
+                return svn_error_createf(
+                         SVN_ERR_WC_DB_ERROR, NULL,
+                         _("The node '%s' comes from unexpected repository "
+                           "'%s', expected '%s'; if this node is a file "
+                           "external using the correct URL in the external "
+                           "definition can fix the problem, see issue #4087"),
+                         child_relpath, repos_root_url, last_repos_root_url);
               child->repos_root_url = repos_root_url;
               child->repos_uuid = repos_uuid;
             }

Modified: subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/dav_svn.h?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/dav_svn.h Fri Feb 17 10:52:38 2012
@@ -949,6 +949,14 @@ dav_svn__final_flush_or_error(request_re
                               ap_filter_t *output, dav_error *preferred_err,
                               apr_pool_t *pool);
 
+/* Log a DAV error response.
+ *
+ * NOTE: Copied from mod_dav's dav_log_err which is not public.
+ */
+void dav_svn__log_err(request_rec *r,
+                      dav_error *err,
+                      int level);
+
 /* Send a "standardized" DAV error response based on the ERR's
  * namespace and tag.
  *

Modified: subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/liveprops.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/liveprops.c Fri Feb 17 10:52:38 2012
@@ -25,6 +25,7 @@
 
 #include <httpd.h>
 #include <http_core.h>
+#include <http_log.h>
 #include <util_xml.h>
 #include <mod_dav.h>
 
@@ -377,7 +378,12 @@ insert_prop_internal(const dav_resource 
                                            scratch_pool);
             if (serr != NULL)
               {
-                /* ### what to do? */
+                ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                              resource->info->r,
+                              "Can't get created-rev of '%s': "
+                              "%s",
+                              resource->info->repos_path,
+                              serr->message);
                 svn_error_clear(serr);
                 value = "###error###";
                 break;
@@ -395,7 +401,12 @@ insert_prop_internal(const dav_resource 
                                 scratch_pool);
         if (serr)
           {
-            /* ### what to do? */
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                          resource->info->r,
+                          "Can't get author of r%ld: "
+                          "%s",
+                          committed_rev,
+                          serr->message);
             svn_error_clear(serr);
             value = "###error###";
             break;
@@ -536,7 +547,13 @@ insert_prop_internal(const dav_resource 
                                      scratch_pool);
           if (serr != NULL)
             {
-              /* ### what to do? */
+              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                            resource->info->r,
+                            "Can't get youngest revision in '%s': "
+                            "%s",
+                            svn_fs_path(resource->info->repos->fs,
+                                        scratch_pool),
+                            serr->message);
               svn_error_clear(serr);
               value = "###error###";
               break;
@@ -610,7 +627,12 @@ insert_prop_internal(const dav_resource 
                                          scratch_pool);
           if (serr != NULL)
             {
-              /* ### what to do? */
+              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                            resource->info->r,
+                            "Can't get created-rev of '%s': "
+                            "%s",
+                            resource->info->repos_path,
+                            serr->message);
               svn_error_clear(serr);
               value = "###error###";
               break;
@@ -641,20 +663,32 @@ insert_prop_internal(const dav_resource 
               || resource->type == DAV_RESOURCE_TYPE_WORKING
               || resource->type == DAV_RESOURCE_TYPE_VERSION))
         {
+          svn_node_kind_t kind;
           svn_checksum_t *checksum;
 
-          serr = svn_fs_file_checksum(&checksum, svn_checksum_md5,
-                                      resource->info->root.root,
-                                      resource->info->repos_path, TRUE,
-                                      scratch_pool);
+          serr = svn_fs_check_path(&kind, resource->info->root.root,
+                                   resource->info->repos_path, scratch_pool);
+          if (!serr && kind == svn_node_file)
+            serr = svn_fs_file_checksum(&checksum, svn_checksum_md5,
+                                        resource->info->root.root,
+                                        resource->info->repos_path, TRUE,
+                                        scratch_pool);
           if (serr != NULL)
             {
-              /* ### what to do? */
+              ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                            resource->info->r,
+                            "Can't fetch or compute MD5 checksum of '%s': "
+                            "%s",
+                            resource->info->repos_path,
+                            serr->message);
               svn_error_clear(serr);
               value = "###error###";
               break;
             }
 
+          if (kind != svn_node_file)
+            return DAV_PROP_INSERT_NOTSUPP;
+
           value = svn_checksum_to_cstring(checksum, scratch_pool);
 
           if (! value)
@@ -669,7 +703,12 @@ insert_prop_internal(const dav_resource 
       serr = svn_fs_get_uuid(resource->info->repos->fs, &value, scratch_pool);
       if (serr != NULL)
         {
-          /* ### what to do? */
+          ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                        resource->info->r,
+                        "Can't fetch UUID of '%s': "
+                        "%s",
+                        svn_fs_path(resource->info->repos->fs, scratch_pool),
+                        serr->message);
           svn_error_clear(serr);
           value = "###error###";
           break;
@@ -689,7 +728,12 @@ insert_prop_internal(const dav_resource 
                                     resource->info->repos_path, scratch_pool);
         if (serr != NULL)
           {
-            /* ### what to do? */
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, serr->apr_err, 
+                          resource->info->r,
+                          "Can't fetch proplist of '%s': "
+                          "%s",
+                          resource->info->repos_path,
+                          serr->message);
             svn_error_clear(serr);
             value = "###error###";
             break;

Modified: subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/log.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/log.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/log.c Fri Feb 17 10:52:38 2012
@@ -30,6 +30,7 @@
 #include "svn_repos.h"
 #include "svn_string.h"
 #include "svn_types.h"
+#include "svn_base64.h"
 #include "svn_xml.h"
 #include "svn_path.h"
 #include "svn_dav.h"
@@ -61,6 +62,9 @@ struct log_receiver_baton
 
   /* whether the client requested any custom revprops */
   svn_boolean_t requested_custom_revprops;
+
+  /* whether the client can handle encoded binary property values */
+  svn_boolean_t encode_binary_props;
 };
 
 
@@ -119,35 +123,50 @@ log_receiver(void *baton,
            hi = apr_hash_next(hi))
         {
           char *name;
-          svn_string_t *value;
+          void *val;
+          const svn_string_t *value;
+          const char *encoding_str = "";
 
           svn_pool_clear(iterpool);
-          apr_hash_this(hi, (void *)&name, NULL, (void *)&value);
+          apr_hash_this(hi, (void *)&name, NULL, &val);
+          value = val;
+
+          /* If the client is okay with us encoding binary (or really,
+             any non-XML-safe) property values, do so as necessary. */
+          if (lrb->encode_binary_props)
+            {
+              if (! svn_xml_is_xml_safe(value->data, value->len))
+                {
+                  value = svn_base64_encode_string2(value, TRUE, iterpool);
+                  encoding_str = " encoding=\"base64\"";
+                }
+            }
+
           if (strcmp(name, SVN_PROP_REVISION_AUTHOR) == 0)
             SVN_ERR(dav_svn__brigade_printf
                     (lrb->bb, lrb->output,
-                     "<D:creator-displayname>%s</D:creator-displayname>"
-                     DEBUG_CR,
+                     "<D:creator-displayname%s>%s</D:creator-displayname>"
+                     DEBUG_CR, encoding_str,
                      apr_xml_quote_string(iterpool, value->data, 0)));
           else if (strcmp(name, SVN_PROP_REVISION_DATE) == 0)
             /* ### this should be DAV:creation-date, but we need to format
                ### that date a bit differently */
             SVN_ERR(dav_svn__brigade_printf
                     (lrb->bb, lrb->output,
-                     "<S:date>%s</S:date>" DEBUG_CR,
+                     "<S:date%s>%s</S:date>" DEBUG_CR, encoding_str,
                      apr_xml_quote_string(iterpool, value->data, 0)));
           else if (strcmp(name, SVN_PROP_REVISION_LOG) == 0)
             SVN_ERR(dav_svn__brigade_printf
                     (lrb->bb, lrb->output,
-                     "<D:comment>%s</D:comment>" DEBUG_CR,
+                     "<D:comment%s>%s</D:comment>" DEBUG_CR, encoding_str,
                      apr_xml_quote_string(pool,
                                           svn_xml_fuzzy_escape(value->data,
                                                                iterpool), 0)));
           else
             SVN_ERR(dav_svn__brigade_printf
                     (lrb->bb, lrb->output,
-                     "<S:revprop name=\"%s\">%s</S:revprop>" DEBUG_CR,
-                     apr_xml_quote_string(iterpool, name, 0),
+                     "<S:revprop name=\"%s\"%s>%s</S:revprop>" DEBUG_CR,
+                     apr_xml_quote_string(iterpool, name, 0), encoding_str,
                      apr_xml_quote_string(iterpool, value->data, 0)));
         }
     }
@@ -305,6 +324,7 @@ dav_svn__log_report(const dav_resource *
   seen_revprop_element = FALSE;
 
   lrb.requested_custom_revprops = FALSE;
+  lrb.encode_binary_props = FALSE;
   for (child = doc->root->first_child; child != NULL; child = child->next)
     {
       /* if this element isn't one of ours, then skip it */
@@ -333,6 +353,8 @@ dav_svn__log_report(const dav_resource *
         strict_node_history = TRUE; /* presence indicates positivity */
       else if (strcmp(child->name, "include-merged-revisions") == 0)
         include_merged_revisions = TRUE; /* presence indicates positivity */
+      else if (strcmp(child->name, "encode-binary-props") == 0)
+        lrb.encode_binary_props = TRUE; /* presence indicates positivity */
       else if (strcmp(child->name, "all-revprops") == 0)
         {
           revprops = NULL; /* presence indicates fetch all revprops */

Modified: subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/update.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/reports/update.c Fri Feb 17 10:52:38 2012
@@ -941,8 +941,8 @@ dav_svn__update_report(const dav_resourc
           cdata = dav_xml_get_cdata(child, resource->pool, 0);
           if (! *cdata)
             return malformed_element_error(child->name, resource->pool);
-          if ((derr = dav_svn__test_canonical(cdata, resource->pool)))
-            return derr;
+          if (svn_path_is_url(cdata))
+            cdata = svn_uri_canonicalize(cdata, resource->pool);
           if ((serr = dav_svn__simple_parse_uri(&this_info, resource,
                                                 cdata, resource->pool)))
             return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
@@ -956,8 +956,8 @@ dav_svn__update_report(const dav_resourc
           cdata = dav_xml_get_cdata(child, resource->pool, 0);
           if (! *cdata)
             return malformed_element_error(child->name, resource->pool);
-          if ((derr = dav_svn__test_canonical(cdata, resource->pool)))
-            return derr;
+          if (svn_path_is_url(cdata))
+            cdata = svn_uri_canonicalize(cdata, resource->pool);
           if ((serr = dav_svn__simple_parse_uri(&this_info, resource,
                                                 cdata, resource->pool)))
             return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,

Modified: subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/repos.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/repos.c Fri Feb 17 10:52:38 2012
@@ -3240,8 +3240,8 @@ deliver(const dav_resource *resource, ap
                                      resource->pool, resource->pool);
           if (serr != NULL)
             return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
-                                        "couldn't fetch dirents of SVNParentPath",
-                                        resource->pool);
+                                        "could not fetch dirents of "
+                                        "SVNParentPath", resource->pool);
 
           /* convert an io dirent hash to an fs dirent hash. */
           entries = apr_hash_make(resource->pool);
@@ -3259,18 +3259,21 @@ deliver(const dav_resource *resource, ap
               if (dirent->kind == svn_node_file && dirent->special)
                 {
                   svn_node_kind_t resolved_kind;
-                  const char *name = key;
+                  const char *link_path = 
+                    svn_dirent_join(fs_parent_path, key, resource->pool);
 
-                  serr = svn_io_check_resolved_path(name, &resolved_kind,
+                  serr = svn_io_check_resolved_path(link_path, &resolved_kind,
                                                     resource->pool);
-                  if (serr != NULL)
+                  if (serr)
                     return dav_svn__convert_err(serr,
                                                 HTTP_INTERNAL_SERVER_ERROR,
-                                                "couldn't fetch dirents "
-                                                "of SVNParentPath",
+                                                "could not resolve symlink "
+                                                "dirent of SVNParentPath",
                                                 resource->pool);
                   if (resolved_kind != svn_node_dir)
                     continue;
+                  
+                  dirent->kind = svn_node_dir;
                 }
               else if (dirent->kind != svn_node_dir)
                 continue;
@@ -4467,7 +4470,12 @@ int dav_svn__method_post(request_rec *r)
   /* If something went wrong above, we'll generate a response back to
      the client with (hopefully) some helpful information. */
   if (derr)
-    return dav_svn__error_response_tag(r, derr);
+    {
+      /* POST is not a DAV method and so mod_dav isn't involved and
+         won't log this error.  Do it explicitly. */
+      dav_svn__log_err(r, derr, APLOG_ERR);
+      return dav_svn__error_response_tag(r, derr);
+    }
 
   return OK;
 }

Modified: subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/util.c?rev=1245385&r1=1245384&r2=1245385&view=diff
==============================================================================
--- subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/1.7.x-r1210147/subversion/mod_dav_svn/util.c Fri Feb 17 10:52:38 2012
@@ -615,6 +615,30 @@ dav_svn__final_flush_or_error(request_re
   return derr;
 }
 
+void dav_svn__log_err(request_rec *r,
+                      dav_error *err,
+                      int level)
+{
+    dav_error *errscan;
+
+    /* Log the errors */
+    /* ### should have a directive to log the first or all */
+    for (errscan = err; errscan != NULL; errscan = errscan->prev) {
+        if (errscan->desc == NULL)
+            continue;
+
+        if (errscan->save_errno != 0) {
+            errno = errscan->save_errno;
+            ap_log_rerror(APLOG_MARK, level, errno, r, "%s  [%d, #%d]",
+                          errscan->desc, errscan->status, errscan->error_id);
+        }
+        else {
+            ap_log_rerror(APLOG_MARK, level, 0, r,
+                          "%s  [%d, #%d]",
+                          errscan->desc, errscan->status, errscan->error_id);
+        }
+    }
+}
 
 int
 dav_svn__error_response_tag(request_rec *r,
@@ -634,8 +658,10 @@ dav_svn__error_response_tag(request_rec 
   if (err->namespace != NULL)
     ap_rprintf(r, " xmlns:C=\"%s\">" DEBUG_CR "<C:%s/>" DEBUG_CR,
                err->namespace, err->tagname);
-  else
+  else if (err->tagname != NULL)
     ap_rprintf(r, ">" DEBUG_CR "<D:%s/>" DEBUG_CR, err->tagname);
+  else
+    ap_rputs(">" DEBUG_CR, r);
 
   /* here's our mod_dav specific tag: */
   if (err->desc != NULL)



Mime
View raw message