You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Sviataslau Svirydau <Sv...@epam.com> on 2004/12/07 16:00:11 UTC

[BUG] svn_load_dirs.pl does not quote filenames when running shell

Hello,

I've found a bug in svn_load_dirs.pl. It passes filenames to shell as is 
without quotation. This leads to fail if filename contain some special 
characters. In my case I had filename with brackets and svn_load_dirs.pl 
was failed when processing this file. I've managed to fix it for me (see 
patch below), though I'm not an expert in perl, so a solution might be 
not the best. Anyway, I think it's needed to quote filenames anywhere 
when shell is called (I've fixed it for me at only one place).

PS I not subscribed to this list, so please CC me when answering

PPS here is a patch:

-----------------------------
--- svn_load_dirs.pl~   2004-12-07 17:49:19 +0200
+++ svn_load_dirs.pl    2004-12-06 19:37:46 +0200
@@ -1162,7 +1162,7 @@ while (defined (my $load_dir = &get_next
                         keys %upd_files;
         foreach my $upd_file (@upd_files)
           {
-            my @command = ($svn, 'propget', 'svn:eol-style', $upd_file);
+            my @command = ($svn, 'propget', 'svn:eol-style', 
"\'$upd_file\'");
             my @lines = read_from_process(@command);
             next unless @lines;
             if (@lines > 1)
-----------------------------

-- 
Best Regards,
Sviataslau Svirydau <Sviataslau_Svirydau at epam.com>
phone:  +375 (17) 210 1662, ext. 1503
fax:    +375 (17) 210 1168
mobile: +375 (29) 641 4214
-- 
There's got to be more to life than compile-and-go.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [BUG] svn_load_dirs.pl does not quote filenames when running shell

Posted by kf...@collab.net.
Thanks for the bug report!  Can you resend it to
dev@subversion.tigris.org?

(I'd apply it myself, but I suspect there will be more places that
need fixing, and hopefully someone with a bit more familiarity with
svn_load_dirs.pl can take a look.)

-Karl

Sviataslau Svirydau <Sv...@epam.com> writes:
> Hello,
> 
> I've found a bug in svn_load_dirs.pl. It passes filenames to shell as
> is without quotation. This leads to fail if filename contain some
> special characters. In my case I had filename with brackets and
> svn_load_dirs.pl was failed when processing this file. I've managed to
> fix it for me (see patch below), though I'm not an expert in perl, so
> a solution might be not the best. Anyway, I think it's needed to quote
> filenames anywhere when shell is called (I've fixed it for me at only
> one place).
> 
> PS I not subscribed to this list, so please CC me when answering
> 
> PPS here is a patch:
> 
> -----------------------------
> --- svn_load_dirs.pl~   2004-12-07 17:49:19 +0200
> +++ svn_load_dirs.pl    2004-12-06 19:37:46 +0200
> @@ -1162,7 +1162,7 @@ while (defined (my $load_dir = &get_next
>                          keys %upd_files;
>          foreach my $upd_file (@upd_files)
>            {
> -            my @command = ($svn, 'propget', 'svn:eol-style', $upd_file);
> +            my @command = ($svn, 'propget', 'svn:eol-style',
> "\'$upd_file\'");
>              my @lines = read_from_process(@command);
>              next unless @lines;
>              if (@lines > 1)
> -----------------------------
> 
> -- 
> Best Regards,
> Sviataslau Svirydau <Sviataslau_Svirydau at epam.com>
> phone:  +375 (17) 210 1662, ext. 1503
> fax:    +375 (17) 210 1168
> mobile: +375 (29) 641 4214
> -- 
> There's got to be more to life than compile-and-go.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org