git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Rast <trast@inf.ethz.ch>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, "Brandon Casey" <drafnel@gmail.com>,
	"Uwe Kleine-König" <ukleinek@informatik.uni-freiburg.de>,
	"Brian Gernhardt" <brian@gernhardtsoftware.com>,
	"Robin H. Johnson" <robbat2@gentoo.org>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH] send-email: add extra safetly in address sanitazion
Date: Sun, 5 Feb 2012 20:39:57 +0100	[thread overview]
Message-ID: <87sjipxe5u.fsf@thomas.inf.ethz.ch> (raw)
In-Reply-To: <1328373162-25188-1-git-send-email-felipe.contreras@gmail.com> (Felipe Contreras's message of "Sat, 4 Feb 2012 18:32:42 +0200")

Felipe Contreras <felipe.contreras@gmail.com> writes:

> Currently bad addresses like 'Foo Bar <foo@bar.com>>' will just be sent
> verbatim -- that's not good; we should either error out, or sanitize
> them.
>
> The following patch adds extra sanitazion so the following
> transformations are performed:
>
>   'Foo Bar <foo@bar.com>' -> 'Foo Bar <foo@bar.com>'
>   '"Foo Bar" <foo@bar.com>' -> '"Foo Bar" <foo@bar.com>'
>   'foo@bar.com' -> 'foo@bar.com'
>   '<foo@bar.com>' -> 'foo@bar.com'
>   'Foo Bar' -> 'Foo Bar'

Am I the only one who stared at this for ten seconds, only to then
realize that there is no sanitizing whatsoever going on here?

>   'Foo Bar <foo@bar.com>>' -> 'Foo Bar <foo@bar.com>'
>   '"Foo Bar" <foo@bar.com>>' -> '"Foo Bar" <foo@bar.com>'
>   '<foo@bar.com>>' -> 'foo@bar.com'

All of these are the same underlying issue.  Does your patch fix any
other malformed addresses, or just this particular type?

> Basically, we try to check that the address is in the form of
> "Name <email>", and if not, assume it's "email". According to commit
> 155197e[1], the "prhase" should not be empty, so if it is, remove the
                   ^^^^^^
"phrase"

>  git-send-email.perl |   14 ++++++++++----
>  1 files changed, 10 insertions(+), 4 deletions(-)

Tests?

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

  reply	other threads:[~2012-02-05 19:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-04 16:32 [PATCH] send-email: add extra safetly in address sanitazion Felipe Contreras
2012-02-05 19:39 ` Thomas Rast [this message]
2012-02-05 20:51   ` Felipe Contreras
2012-02-05 21:51     ` Thomas Rast
2012-02-06  1:27       ` Felipe Contreras
2012-02-06  1:48         ` Junio C Hamano
2012-02-05 21:52   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2012-02-04 15:10 Felipe Contreras
2012-02-04 15:26 ` Felipe Contreras
2012-02-05 21:12   ` Junio C Hamano
2012-02-05 21:20     ` Felipe Contreras

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=87sjipxe5u.fsf@thomas.inf.ethz.ch \
    --to=trast@inf.ethz.ch \
    --cc=avarab@gmail.com \
    --cc=brian@gernhardtsoftware.com \
    --cc=drafnel@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=robbat2@gentoo.org \
    --cc=ukleinek@informatik.uni-freiburg.de \
    /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).