You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2012/04/25 22:26:04 UTC

svn commit: r1330538 - in /subversion/trunk/subversion: libsvn_repos/hooks.c mod_dav_svn/lock.c

Author: stsp
Date: Wed Apr 25 20:26:04 2012
New Revision: 1330538

URL: http://svn.apache.org/viewvc?rev=1330538&view=rev
Log:
Follow-up to 1330516: Restore pre-lock hook stderr output to the client.
This feature was broken accidentally.

Found by: philip

* subversion/mod_dav_svn/lock.c
  (append_locks, refresh_locks): Do no sanitize hook errors.

* subversion/libsvn_repos/hooks.c
  (run_hook_cmd): When the hook fails to start, do not use the error
   code SVN_ERR_REPOS_HOOK_FAILURE. Use SVN_ERR_REPOS_BAD_ARGS instead.
   This way, the full path to the pre-lock hook that could not be started
   is logged by mod_dav_svn but not exposed to the client.

Modified:
    subversion/trunk/subversion/libsvn_repos/hooks.c
    subversion/trunk/subversion/mod_dav_svn/lock.c

Modified: subversion/trunk/subversion/libsvn_repos/hooks.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/hooks.c?rev=1330538&r1=1330537&r2=1330538&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/hooks.c (original)
+++ subversion/trunk/subversion/libsvn_repos/hooks.c Wed Apr 25 20:26:04 2012
@@ -242,9 +242,8 @@ run_hook_cmd(svn_string_t **result,
     err = check_hook_result(name, cmd, &cmd_proc, cmd_proc.err, pool);
   else
     {
-      /* The command could not be started for some reason.
-       * Put a hook failure error into the error chain. */
-      err = svn_error_createf(SVN_ERR_REPOS_HOOK_FAILURE, err,
+      /* The command could not be started for some reason. */
+      err = svn_error_createf(SVN_ERR_REPOS_BAD_ARGS, err,
                               _("Failed to start '%s' hook"), cmd);
     }
 

Modified: subversion/trunk/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/lock.c?rev=1330538&r1=1330537&r2=1330538&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/lock.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/lock.c Wed Apr 25 20:26:04 2012
@@ -765,6 +765,10 @@ append_locks(dav_lockdb *lockdb,
                                 DAV_ERR_LOCK_SAVE_LOCK,
                                 "Anonymous lock creation is not allowed.");
     }
+  else if (serr && serr->apr_err == SVN_ERR_REPOS_HOOK_FAILURE)
+     return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+                                 "Failed to create new lock.",
+                                 resource->pool);
   else if (serr)
     return dav_svn__sanitize_error(serr, "Failed to create new lock.",
                                    HTTP_INTERNAL_SERVER_ERROR,
@@ -956,6 +960,10 @@ refresh_locks(dav_lockdb *lockdb,
                                 DAV_ERR_LOCK_SAVE_LOCK,
                                 "Anonymous lock refreshing is not allowed.");
     }
+  else if (serr && serr->apr_err == SVN_ERR_REPOS_HOOK_FAILURE)
+     return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+                                 "Failed to refresh existing lock.",
+                                 resource->pool);
   else if (serr)
     return dav_svn__sanitize_error(serr, "Failed to refresh existing lock.",
                                    HTTP_INTERNAL_SERVER_ERROR,