From: Jeff King <peff@peff.net>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Jay Soffian <jaysoffian@gmail.com>,
Benjamin C Meyer <bmeyer@rim.com>,
git@vger.kernel.org
Subject: Re: [PATCH] Put quotes around branch names to prevent special characters from being interpreted by the shell.
Date: Mon, 7 Jun 2010 02:01:47 -0400 [thread overview]
Message-ID: <20100607060147.GA20958@coredump.intra.peff.net> (raw)
In-Reply-To: <AANLkTik7PV-2u24UF78U6rtuffw4XUGS1F4hD2_ElrZZ@mail.gmail.com>
On Mon, Jun 07, 2010 at 05:48:11AM +0000, Ævar Arnfjörð Bjarmason wrote:
> On Mon, Jun 7, 2010 at 05:10, Jay Soffian <jaysoffian@gmail.com> wrote:
> > BTW, quotemeta is technically intended for use with regular
> > expressions, isn't it?
>
> Yes, it's completely insecure to use it for shell interpolation.
It's intended for use with regexps, but I don't think it is insecure for
shell interpolation. According to perldoc, it quotes 'all characters not
matching "/[A-Za-z_0-9]/"'. So it's excessive for shell quoting, but not
insecure.
> In Perl it's best to use the list form of system() so that the command
> will escape things for you automatically.
Agreed, but it's not escaping things automatically. It simply skips the
shell invocation entirely.
-Peff
prev parent reply other threads:[~2010-06-07 6:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-04 15:53 [PATCH] Put quotes around branch names to prevent special characters from being interpreted by the shell Benjamin C Meyer
2010-06-06 21:55 ` Jeff King
2010-06-07 5:10 ` Jay Soffian
2010-06-07 5:48 ` Ævar Arnfjörð Bjarmason
2010-06-07 6:01 ` Ian Ward Comfort
2010-06-07 6:01 ` Jeff King [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100607060147.GA20958@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=avarab@gmail.com \
--cc=bmeyer@rim.com \
--cc=git@vger.kernel.org \
--cc=jaysoffian@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).