You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by sv...@apache.org on 2012/09/05 06:01:28 UTC

svn commit: r1380969 - in /subversion/branches/1.6.x: ./ STATUS subversion/libsvn_ra_svn/client.c subversion/svnserve/serve.c

Author: svn-role
Date: Wed Sep  5 04:01:27 2012
New Revision: 1380969

URL: http://svn.apache.org/viewvc?rev=1380969&view=rev
Log:
Reintegrate the 1.6.x-r1306111 branch:

 * r1306111
   Handle NULL dates in libsvn_ra_svn.
   Justification:
     Avoids segfault.
   Branch:
     ^/subversion/branches/1.6.x-r1306111
   Votes:
     +1: danielsh, stsp, philip

Modified:
    subversion/branches/1.6.x/   (props changed)
    subversion/branches/1.6.x/STATUS
    subversion/branches/1.6.x/subversion/libsvn_ra_svn/client.c
    subversion/branches/1.6.x/subversion/svnserve/serve.c

Propchange: subversion/branches/1.6.x/
------------------------------------------------------------------------------
  Merged /subversion/branches/1.7.x-r1306111:r1306302-1331000
  Merged /subversion/trunk:r1306111
  Merged /subversion/branches/1.6.x-r1306111:r1331052-1380968

Modified: subversion/branches/1.6.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/STATUS?rev=1380969&r1=1380968&r2=1380969&view=diff
==============================================================================
--- subversion/branches/1.6.x/STATUS (original)
+++ subversion/branches/1.6.x/STATUS Wed Sep  5 04:01:27 2012
@@ -91,12 +91,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1306111
-   Handle NULL dates in libsvn_ra_svn.
-   Justification:
-     Avoids segfault.
-   Branch:
-     ^/subversion/branches/1.6.x-r1306111
-   Votes:
-     +1: danielsh, stsp, philip

Modified: subversion/branches/1.6.x/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/libsvn_ra_svn/client.c?rev=1380969&r1=1380968&r2=1380969&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/1.6.x/subversion/libsvn_ra_svn/client.c Wed Sep  5 04:01:27 2012
@@ -1095,7 +1095,18 @@ static svn_error_t *ra_svn_get_dir(svn_r
       dirent->size = size;/* FIXME: svn_filesize_t */
       dirent->has_props = has_props;
       dirent->created_rev = crev;
-      SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
+      /* NOTE: the tuple's format string says CDATE may be NULL. But this
+         function does not allow that. The server has always sent us some
+         random date, however, so this just happens to work. But let's
+         be wary of servers that are (improperly) fixed to send NULL.
+
+         Note: they should NOT be "fixed" to send NULL, as that would break
+         any older clients which received that NULL. But we may as well
+         be defensive against a malicous server.  */
+      if (cdate == NULL)
+        dirent->time = 0;
+      else
+        SVN_ERR(svn_time_from_cstring(&dirent->time, cdate, pool));
       dirent->last_author = cauthor;
       apr_hash_set(*dirents, name, APR_HASH_KEY_STRING, dirent);
     }

Modified: subversion/branches/1.6.x/subversion/svnserve/serve.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.6.x/subversion/svnserve/serve.c?rev=1380969&r1=1380968&r2=1380969&view=diff
==============================================================================
--- subversion/branches/1.6.x/subversion/svnserve/serve.c (original)
+++ subversion/branches/1.6.x/subversion/svnserve/serve.c Wed Sep  5 04:01:27 2012
@@ -1499,12 +1499,18 @@ static svn_error_t *get_dir(svn_ra_svn_c
   SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(!"));
   if (want_contents)
     {
+      const char *missing_date = svn_time_to_cstring(0, pool);
       for (hi = apr_hash_first(pool, entries); hi; hi = apr_hash_next(hi))
         {
           apr_hash_this(hi, &key, NULL, &val);
           name = key;
           entry = val;
-          cdate = (entry->time == (time_t) -1) ? NULL
+          /* The client does not properly handle a missing CDATE. For
+             interoperability purposes, we must fill in some junk.
+
+             See libsvn_ra_svn/client.c:ra_svn_get_dir()  */
+          cdate = (entry->time == (time_t) -1)
+            ? missing_date
             : svn_time_to_cstring(entry->time, pool);
           SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "cwnbr(?c)(?c)", name,
                                          svn_node_kind_to_word(entry->kind),