[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Lack of validation in svn_repos_open()

From: Greg Hudson <ghudson_at_MIT.EDU>
Date: 2005-12-07 07:42:50 CET

On Tue, 2005-12-06 at 15:22 -0800, Daniel Rall wrote:
> I also would prefer that we return an error. However, Greg mentioned
> that not all functions which trigger this assertion necessarily return
> a svn_error_t *. What would be the scope of the API impact of
> adding/changing the return types where necessary?

Well, we could rev the APIs, but it would make some of them needlessly
more irritating to use. For instance, if you've correctly canonicalized
a path, you can use svn_path_basename() in an expression because you
know it will always succeed. If that function returned an svn_error_t *
because of the possibility of incorrect input, such uses would become
more cumbersome.

The UTF-8 translation case is not particularly similar. In the path
case, the onus is not on the user to provide canonical input; the onus
is on the calling code to canonicalize the user-provided input once,
presumably close to when the input is received, so that it can be
manipulated more predictably later on.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 7 07:44:04 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.