From: Ben Bennett <benbennett@gmail.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Sverre Rabbelier <srabbelier@gmail.com>, git@vger.kernel.org
Subject: Re: clone from url with email address as username?(escaping @ symbol)
Date: Tue, 29 Sep 2009 12:51:41 -0500 [thread overview]
Message-ID: <970bc7c80909291051q5dff9209u650cee4f84d92fae@mail.gmail.com> (raw)
In-Reply-To: <vpq63b1u1p6.fsf@bauges.imag.fr>
Is it escaping the %40 when passed down? I am getting an error 401 ,
and checking the server logs , it is passing the %40 to the server in
the username.
Running curl from command line , I can connect, but through git , the
username is getting mangled or I have something screwed up.
I will look at http.c tonight after work, to see if I am messing something up.
Thanks,
Ben
On Tue, Sep 29, 2009 at 11:59 AM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Ben Bennett <benbennett@gmail.com> writes:
>
>> I am attempting to do a https clone. The username is an email address
>> but when I do a clone here is what happens.
>
> Hmm, right, it works with ssh, but not http.
>
> I tried a quick fix like this:
>
> diff --git a/http.c b/http.c
> index 23b2a19..361a6be 100644
> --- a/http.c
> +++ b/http.c
> @@ -281,9 +281,10 @@ static void http_auth_init(const char *url)
> * "proto://<host>/..."?
> */
> cp += 3;
> - at = strchr(cp, '@');
> colon = strchr(cp, ':');
> slash = strchrnul(cp, '/');
> + for(at = slash-1; *at != '@' && *at != '/'; at--)
> + continue;
> if (!at || slash <= at)
> return; /* No credentials */
> if (!colon || at <= colon) {
>
> Unfortunately, it seems the complete URL is passed to curl, and curl
> is the one doing it wrong. Indeed:
>
> $ curl -v https://user@email.com@server.com/path/
> * getaddrinfo(3) failed for email.com@server.com:443
> * Couldn't resolve host 'email.com@server.com'
> * Closing connection #0
> curl: (6) Couldn't resolve host 'email.com@server.com'
>
> Now for the good news:
>
> http://curl.haxx.se/mail/lib-2006-02/0134.html
> http://sourceforge.net/tracker/index.php?func=detail&aid=2826621&group_id=976&atid=100976
>
> In short, you have to use %40 to escape the @, and curl does it this
> way because the RFC doesn't allow @ in usernames.
>
> --
> Matthieu Moy
> http://www-verimag.imag.fr/~moy/
>
next prev parent reply other threads:[~2009-09-29 17:51 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-29 14:20 clone from url with email address as username?(escaping @ symbol) Ben Bennett
2009-09-29 14:25 ` Sverre Rabbelier
2009-09-29 14:30 ` Matthieu Moy
2009-09-29 14:32 ` Sverre Rabbelier
2009-09-29 15:31 ` Ben Bennett
2009-09-29 16:59 ` Matthieu Moy
2009-09-29 17:07 ` Matthieu Moy
2009-09-29 17:48 ` Daniel Stenberg
2009-09-29 18:09 ` Matthieu Moy
2009-09-29 20:38 ` Daniel Stenberg
2009-09-29 20:47 ` Matthieu Moy
2009-09-29 17:51 ` Ben Bennett [this message]
2009-09-29 18:03 ` Matthieu Moy
2009-09-29 18:12 ` Matthieu Moy
2009-09-29 18:55 ` Ben Bennett
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=970bc7c80909291051q5dff9209u650cee4f84d92fae@mail.gmail.com \
--to=benbennett@gmail.com \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=srabbelier@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).