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

Re: Input validation observations

From: Noorul Islam K M <noorul_at_collab.net>
Date: Fri, 03 Dec 2010 16:41:19 +0530

Julian Foad <julian.foad_at_wandisco.com> writes:

> I tried some potentially invalid inputs to "svn" a week or two ago and
> made notes on what I found. Just posting here in case anyone wants to
> do something about one or more of them.
>
> Noorul, I'm including you in the "To" addresses because you said you
> were looking for more small tasks to do, so feel free to pick one of
> these if you want to.
>
> Where I end with a question mark, it means I'm not sure if we want this
> change, it's just a suggestion.
>
>
> * "svn info ^/b" -> "Not a valid URL"; should be "path '/b' not found
> in revision REV"?
>

Patch attached.

Log
[[[

Make "svn info" to display the actual error message returned by API when
illegal URL is passed.

* subversion/svn/info-cmd.c
  (svn_cl__info): Display the actual error message returned by
  svn_client_info3() instead of a custom one.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>
]]]

Thanks and Regards
Noorul

Index: subversion/svn/info-cmd.c
===================================================================
--- subversion/svn/info-cmd.c (revision 1041293)
+++ subversion/svn/info-cmd.c (working copy)
@@ -584,12 +584,8 @@
             }
           else if (err->apr_err == SVN_ERR_RA_ILLEGAL_URL)
             {
- SVN_ERR(svn_cmdline_fprintf
- (stderr, subpool,
- _("%s: (Not a valid URL)\n\n"),
- svn_path_is_url(truepath)
- ? truepath
- : svn_dirent_local_style(truepath, pool)));
+ SVN_ERR(svn_cmdline_fprintf (stderr, subpool,
+ _("%s\n\n"), err->message));
             }
           else
             {
Received on 2010-12-03 12:13:59 CET

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