You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/07/22 20:40:52 UTC

svn commit: r1149690 - in /subversion/branches/1.7.x: ./ STATUS subversion/libsvn_repos/hooks.c subversion/libsvn_subr/io.c

Author: hwright
Date: Fri Jul 22 18:40:51 2011
New Revision: 1149690

URL: http://svn.apache.org/viewvc?rev=1149690&view=rev
Log:
Merge r1149675 from trunk:

 * r1149675
   Add error checking.
   Justification:
     Address a segfault (and a file descriptor leak) in svnsync of an ra_serf
     source to an ra_local target.
   Votes:
     +1: danielsh, stsp, hwright

Modified:
    subversion/branches/1.7.x/   (props changed)
    subversion/branches/1.7.x/STATUS
    subversion/branches/1.7.x/subversion/libsvn_repos/hooks.c
    subversion/branches/1.7.x/subversion/libsvn_subr/io.c

Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 22 18:40:51 2011
@@ -54,4 +54,4 @@
 /subversion/branches/tree-conflicts:868291-873154
 /subversion/branches/tree-conflicts-notify:873926-874008
 /subversion/branches/uris-as-urls:1060426-1064427
-/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149572
+/subversion/trunk:1146013,1146121,1146219,1146222,1146274,1146492,1146555,1146606,1146620,1146684,1146781,1146832,1146834,1146870,1146899,1146904,1147293,1147309,1148071,1148131,1148374,1148424,1148566,1148588,1148853,1148877,1148882,1148936,1149105,1149141,1149160,1149228,1149240,1149572,1149675

Modified: subversion/branches/1.7.x/STATUS
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/STATUS?rev=1149690&r1=1149689&r2=1149690&view=diff
==============================================================================
--- subversion/branches/1.7.x/STATUS (original)
+++ subversion/branches/1.7.x/STATUS Fri Jul 22 18:40:51 2011
@@ -127,11 +127,3 @@ Veto-blocked changes:
 
 Approved changes:
 =================
-
- * r1149675
-   Add error checking.
-   Justification:
-     Address a segfault (and a file descriptor leak) in svnsync of an ra_serf
-     source to an ra_local target.
-   Votes:
-     +1: danielsh, stsp, hwright

Modified: subversion/branches/1.7.x/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_repos/hooks.c?rev=1149690&r1=1149689&r2=1149690&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_repos/hooks.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_repos/hooks.c Fri Jul 22 18:40:51 2011
@@ -202,7 +202,8 @@ run_hook_cmd(svn_string_t **result,
 
   if (err)
     {
-      err = svn_error_createf
+      /* CMD_PROC is not safe to use. Bail. */
+      return svn_error_createf
         (SVN_ERR_REPOS_HOOK_FAILURE, err, _("Failed to start '%s' hook"), cmd);
     }
   else

Modified: subversion/branches/1.7.x/subversion/libsvn_subr/io.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/libsvn_subr/io.c?rev=1149690&r1=1149689&r2=1149690&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/libsvn_subr/io.c (original)
+++ subversion/branches/1.7.x/subversion/libsvn_subr/io.c Fri Jul 22 18:40:51 2011
@@ -2489,10 +2489,17 @@ svn_io_start_cmd2(apr_proc_t *cmd_proc,
 
   /* Forward request for pipes to APR. */
   if (infile_pipe || outfile_pipe || errfile_pipe)
-    apr_procattr_io_set(cmdproc_attr,
-                        infile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
-                        outfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
-                        errfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE);
+    {
+      apr_err = apr_procattr_io_set(cmdproc_attr,
+                                    infile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
+                                    outfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE,
+                                    errfile_pipe ? APR_FULL_BLOCK : APR_NO_PIPE);
+
+      if (apr_err)
+        return svn_error_wrap_apr(apr_err,
+                                  _("Can't set process '%s' stdio pipes"),
+                                  cmd);
+    }
 
   /* Have the child print any problems executing its program to errfile. */
   apr_err = apr_pool_userdata_set(errfile, ERRFILE_KEY, NULL, pool);