You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Chia-liang Kao <cl...@clkao.org> on 2008/06/07 09:16:13 UTC

[PATCH] Fix repos->capability assumption in repos hook

Hi,

It seems svn_repos_remember_client_capabilities is only called in the
ra server side, in other words, if you use the repos api, you can get
a repos object without client_capabilities set which is optional as
repos.h indicates.

However, the svn_repos__hooks_start_commit function assumes capability
is not null, which causes segfault if you have a repository with
enabled start-commit hooks and is being committed with the repos API.
Attached is a patch for this.

I am also wondering why the code has the caller (the only one is
svn_repos_fs_begin_txn_for_commit2) passing the capabilities in rather
than pulling it from repos?  the latter seems more encapsulated to
me...

[[[

* subversion/libsvn_repos/hook.c
  (svn_repos__hooks_start_commit): Don't assume capabilities is non-null.

]]]

Re: [PATCH] Fix repos->capability assumption in repos hook

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Jun 07, 2008 at 05:32:29PM +0800, Chia-liang Kao wrote:
> Oops, I attached the same patch.  Heres' the real one.

Applied in r31620.

Stefan

Re: [PATCH] Fix repos->capability assumption in repos hook

Posted by Chia-liang Kao <cl...@clkao.org>.
Oops, I attached the same patch.  Heres' the real one.
>> [[[
>>
>> * subversion/libsvn_repos/hook.c
>>  (svn_repos__hooks_start_commit): Don't assume capabilities is non-null.
>>
>> ]]]
>>
>

Re: [PATCH] Fix repos->capability assumption in repos hook

Posted by Chia-liang Kao <cl...@clkao.org>.
The patch was half baked, here's the revised one.

> [[[
>
> * subversion/libsvn_repos/hook.c
>  (svn_repos__hooks_start_commit): Don't assume capabilities is non-null.
>
> ]]]
>