git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Convert open("-|") to qx{} calls

From
Alex Riesen <raa.lkml@gmail.com>
Date
Feb 23, 2006, 15:38 UTC
Message-ID
<81b0412b0602230738s3445bd86h2d1d670e0ef5daed@mail.gmail.com>
In-Reply-To
<Pine.LNX.4.63.0602231532470.29635@wbgn013.biozentrum.uni-wuerzburg.de>
On 2/23/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>       Since of these 4, I only use cvsimport myself, I could only test
>       that. Could someone who uses the others give them a hard beating?

I can't really test them (no svn and cvs, and locked down network), but I took a look at the patches. Hope it helps.

git-cvsimport:
> -               open(F,"git-cat-file commit $ftag |");
> -               while(<F>) {
> +               foreach (qx{git-cat-file commit $ftag}) {
>                         next unless /^author\s.*\s(\d+)\s[-+]\d{4}$/;

Are you sure you don't need quoting/safe pipe here? Or is it a CVS tag?

> +} else {
> +    @input = qx{cvsps --norc opt -u -A --root $opt_d $cvs_tree};
> +    !$? or exit $?;
Same here. $cvs_tree can contain any filesystem-allowed character.
git-svnimport:
> -                       my $sha = <$F>;
> +                       my $sha = qx{git-hash-object -w $tmpname};
> +                       !$? or exit $?;
Is $tmpname safe?
> -       my $sha = <$F>;
> +       my $sha = qx{git-hash-object -w $name};
> +       !$? or exit $?;
Is $name safe?
> -       while(<$f>) {
> +       foreach (qx{git-ls-tree -r -z $gitrev $srcpath}) {
>                 chomp;
Is $srcpath safe?
> -                       while(<$F>) {
> +                       foreach (qx{git-ls-files -z @o1}) {
@o1 must contain filenames. Can be dangerous
Previous: Johannes SchindelinNext: Randal L. Schwartz
Message 2 of 13 in “Convert open("-|") to qx{} calls”
  1. Convert open("-|") to qx{} callsJohannes Schindelin, Feb 23, 2006
  2. Alex RiesenFeb 23, 2006
  3. Randal L. SchwartzFeb 23, 2006
  4. Junio C HamanoFeb 23, 2006
  5. Randal L. SchwartzFeb 23, 2006
  6. Johannes SchindelinFeb 23, 2006
  7. Randal L. SchwartzFeb 23, 2006
  8. Alex RiesenFeb 23, 2006
  9. Randal L. SchwartzFeb 23, 2006
  10. Rogan DawesFeb 24, 2006
  11. Alex RiesenFeb 24, 2006
  12. Rogan DawesFeb 24, 2006
  13. Alex RiesenFeb 24, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.