Re: Authz on Collection of Repositories (was: Expansion of authz policy name leak)

2012-10-23 Thread roderich.sch...@gmail.com

>
> I'm working on the patch to list only readable repositories. There is 
>
already TODO comment in the code by cmpilato: 
> subversion\mod_dav_svn\repos.c:3461 
>

Please keep in mind that the problem is not restricted to parent-path 
collections
of repositories: Since SVN 1.7 any user can "list" the root of a 
"standalone"
repository even if she has no access grants whatsoever. Of course, the 
listing
will be empty in this case (but the head revision is leaked). 

Cheers, Roderich


[PATCH] Small fixes to the Perl bindings

2013-01-31 Thread roderich.sch...@gmail.com
Hi,

while trying to use svn_wc_parse_externals_description3 from Perl I 
stumbled over a fex things.
Patches below are against trunk.

perl-bindings-1.patch

[[[
Make svn_wc_parse_externals_description3 available from Perl bindings.

* subversion/bindings/swig/include/svn_containers.swg:
  Add output typemap for APR array of svn_wc_external_item2_t.

* subversion/bindings/swig/perl/native/Wc.pm:
  Document function svn_wc_parse_externals_description3.
  Add the magic to access struct svn_wc_external_item2_t
  as an object and document its methods.

* subversion/bindings/swig/perl/native/Core.pm:
  Fix a typo that prevented the use of 
  _p_svn_opt_revision_value_t objects.
]]]

perl-bindings-2.patch

[[[
Replace inline typemap with a function.

* subversion/bindings/swig/include/svn_types.swg:
  The bulky input typemap for svn_opt_revision_t is inlined
  by Swig for each use in the generated Perl bindings. 
  Move its body ...

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
  (svn_swig_pl_set_revision): ... to a new function here.

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h:
  Add function prototype.
]]]

perl-bindings-3.patch

[[[
Documentation fix for SVN::Ra.

* subversion/bindings/swig/perl/native/Ra.pm
  Fix examples: the $path parameter for SVN::Ra::get_dir() and
  SVN::Ra::get_file() must not start with a slash.
]]]

Cheers, Roderich
Index: subversion/bindings/swig/include/svn_containers.swg
===
--- subversion/bindings/swig/include/svn_containers.swg	(revision 1440883)
+++ subversion/bindings/swig/include/svn_containers.swg	(working copy)
@@ -492,6 +492,12 @@
   }
 }
 #endif
+#ifdef SWIGPERL
+%typemap(argout) apr_array_header_t **externals_p {
+  %append_output
+(svn_swig_pl_convert_array(*$1, $descriptor(svn_wc_external_item2_t *)));
+}
+#endif
 #ifdef SWIGRUBY
 %typemap(argout) apr_array_header_t **externals_p {
   %append_output(svn_swig_rb_apr_array_to_array_external_item2(*$1));
Index: subversion/bindings/swig/perl/native/Wc.pm
===
--- subversion/bindings/swig/perl/native/Wc.pm	(revision 1440883)
+++ subversion/bindings/swig/perl/native/Wc.pm	(working copy)
@@ -13,12 +13,29 @@
 
 Incomplete
 
+=cut
+
+swig_init_asp_dot_net_hack($SVN::Core::gpool);
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item SVN::Wc::parse_externals_description3($parent_directory, $desc, $canonicalize_url, $pool);
+
+Parse the string $desc as an C value and return a reference 
+to an array of L<_p_svn_wc_external_item2_t|svn_wc_external_item2_t> objects. 
+If $canonicalize_url is true, canonicalize the C member of those objects.  
+$parent_directory is only used in constructing error strings.
+
+=back
+
+=cut
+
 =head1 OBJECTS
 
 =cut
 
-swig_init_asp_dot_net_hack($SVN::Core::gpool);
-
 package _p_svn_wc_t;
 
 =head2 svn_wc_status2_t
@@ -228,6 +245,42 @@
 # as method.
 use SVN::Base qw(Wc svn_wc_entry_t_);
 
+=head2 svn_wc_external_item2_t
+
+=over 4
+
+=item $ext-Etarget_dir()
+
+The name of the subdirectory into which this external should be
+checked out.  This is relative to the parent directory that
+holds this external item.  
+
+=item $ext-Eurl()
+
+Where to check out from. This is possibly a relative external URL, as
+allowed in externals definitions, but without the peg revision.
+
+=item $ext-Erevision()
+
+What revision to check out,
+a L object.
+The only valid kind()s for this are $SVN::Core::opt_revision_number,
+$SVN::Core::opt_revision_date, and $SVN::Core::opt_revision_head.
+
+=item $ext-Epeg_revision()
+
+The peg revision to use when checking out, 
+a L object.
+The only valid kind()s for this are $SVN::Core::opt_revision_number,
+$SVN::Core::opt_revision_date, and $SVN::Core::opt_revision_head.
+
+=back
+
+=cut
+
+package _p_svn_wc_external_item2_t;
+use SVN::Base qw(Wc svn_wc_external_item2_t_);
+
 =head1 CONSTANTS
 
 =head2 SVN::Wc::Notify::Action
Index: subversion/bindings/swig/perl/native/Core.pm
===
--- subversion/bindings/swig/perl/native/Core.pm	(revision 1440883)
+++ subversion/bindings/swig/perl/native/Core.pm	(working copy)
@@ -774,8 +774,8 @@
 
 =cut
 
-package _p_svn_opt_revision_t_value;
-use SVN::Base qw(Core svn_opt_revision_t_value_);
+package _p_svn_opt_revision_value_t;
+use SVN::Base qw(Core svn_opt_revision_value_t_);
 
 package _p_svn_config_t;
 use SVN::Base qw(Core svn_config_);
Index: subversion/bindings/swig/include/svn_types.swg
===
--- subversion/bindings/swig/include/svn_types.swg	(revision 1440883)
+++ subversion/bindings/swig/include/svn_types.swg	(working copy)
@@ -1170,52 +1170,7 @@
 #ifdef SWIGPERL
 %typemap(in) svn_opt_revision_t * (svn_opt_revision_t rev) {
 $1 = &rev;
-if ($input == NULL || $input == &PL_sv_undef || !SvOK($input)) {
-rev.kind = svn_opt_revision_unspecifie

Re: [PATCH] Small fixes to the Perl bindings

2013-02-08 Thread roderich.sch...@gmail.com
On Friday, February 8, 2013 1:53:03 AM UTC+1, Ben Reser wrote:
>
> For future reference though if you're adding support for a function 
> it'd be nice to add tests for it. 
>

I'll keep that in mind. Thanks for applying, Ben.

Cheers, Roderich 


Re: Problem with Perl bindings?

2013-07-26 Thread roderich.sch...@gmail.com


On Friday, July 26, 2013 12:50:10 PM UTC+2, Philip Martin wrote:
>
> The trunk change doesn't merge cleanly to either 1.8 or 1.7 so you will 
> need to prepare backports: make backport branches from 1.7.x and 1.8.x 
> branches, merge the change, resolve the conflicts and then nominate the 
> branches. 
>

Done, Roderich 


Re: Branch 'invoke-diff-cmd-feature' is ready for half-way review

2013-10-16 Thread roderich.sch...@gmail.com

On Wednesday, October 16, 2013 3:02:57 AM UTC+2, Gabriela Gibson wrote:
>
> The BRANCH-README file is here: 
>

   Substitutions: ;f1 original file   
  ;f2 changed file 


"svn help diff" uses "old" and "new" (instead of "original" and "changed") 
to refer to these items.
Please stick to established usage.


   Examples: --invoke-diff-cmd="diff -y ;f1 ;f2"
  --invoke-diff-cmd="kdiff3 -auto -o /home/u/log \  
+;f1 ;l2 --L1 ;l1 --L2 "Custom Label" "
In the kdiff3 example the inner double quotes need to be escaped.

 The delimiter ';' can be escaped by adding a ';'

Though it's just a matter of taste, I don't know any precedent for using the 
semicolon as the "substitution introducer". 
Several tools (e.g. GNU diff, GNU find) use the percent sign for this.

Cheers, Roderich



Re: Branch 'invoke-diff-cmd-feature' is ready for half-way review

2013-10-16 Thread roderich.sch...@gmail.com
Looking over __create_custom_diff_cmd() in ./subversion/libsvn_subr/io.c:

(1) The function doesn't strip double quotes, e.g.

_create_custom_diff_cmd(..., /* cmd= */ "duff \"quoted\"", pool)

will return the array { "duff", "\"quoted\"", NULL } 
You probably need to split cmd into tokens yourself  (instead of using

svn_cstring_split and then trying to fix up the result).


(2) 

  result = apr_palloc(pool, 
  (words->nelts+1) * words->elt_size * sizeof(char *) )

Why is words->elt_size needed here - result is an array of char*?

(3) Lifetime issue:

  result[argv] = word->data;

word (and hence word->data) has been allocated in scratch_pool (which will be 
destroyed 
prior to return from __create_custom_diff_cmd), while result has been allocated 
in pool.


Cheers, Roderich



Re: [PATCH] Perl bindings corrupt "{DATE}" revision variable

2016-11-02 Thread roderich.sch...@gmail.com

On Wednesday, November 2, 2016 at 7:48:04 PM UTC+1, Daniel Shahaf wrote:
>
> Do the perl bindings use C89, like libsvn*?  C89 forbids middle-of-block 
> declarations. 
> ...
> The two maybe_croak() calls after this line (one of them in the patch 
> context, one just below it) would now print two right braces. 
>
>
Commited as 1767768, slightly modified to address the above concerns.

Cheers, Roderich