Re: [PATCH] http-push.c: make CURLOPT_IOCTLDATA a usable pointer

2014-07-11 Thread Jeff King
On Sat, Jul 05, 2014 at 08:43:48PM -0400, Abbaad Haider wrote:

> Fixes a small bug affecting push to remotes which use some sort of
> multi-pass authentication. In particular the bug affected SabreDAV as
> configured by Box.com [1].

Thanks. This looks like it was caused by the refactor in ebaaf31
(http-push: refactor curl_easy_setup madness, 2011-05-03), which moved
the curl_easy call into a sub-function which took the buffer as a
pointer, rather than accessing it as a local variable.

> It must be a weird server configuration for the bug to have survived
> this long. Someone should write a test for it.

I think both dumb-http push-over-DAV and multi-pass authentication are
rare, so finding a combination of the two took a while. I do not know
enough about the server setup to know whether we could replicate this in
our test apache setup (and nor do I particularly want to spend a lot of
time figuring it out for the sake of testing push-over-DAV).

> diff --git a/http-push.c b/http-push.c
> index f2c56c8..bd42895 100644
> --- a/http-push.c
> +++ b/http-push.c
> @@ -199,7 +199,7 @@ static void curl_setup_http(CURL *curl, const char *url,
>   curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
>  #ifndef NO_CURL_IOCTL
>   curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_buffer);
> - curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &buffer);
> + curl_easy_setopt(curl, CURLOPT_IOCTLDATA, buffer);

Patch looks obviously correct.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] http-push.c: make CURLOPT_IOCTLDATA a usable pointer

2014-07-05 Thread Abbaad Haider
Fixes a small bug affecting push to remotes which use some sort of
multi-pass authentication. In particular the bug affected SabreDAV as
configured by Box.com [1].

It must be a weird server configuration for the bug to have survived
this long. Someone should write a test for it.

[1] http://marc.info/?l=git&m=140460482604482

Signed-off-by: Abbaad Haider 
---
 http-push.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/http-push.c b/http-push.c
index f2c56c8..bd42895 100644
--- a/http-push.c
+++ b/http-push.c
@@ -199,7 +199,7 @@ static void curl_setup_http(CURL *curl, const char *url,
curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
 #ifndef NO_CURL_IOCTL
curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_buffer);
-   curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &buffer);
+   curl_easy_setopt(curl, CURLOPT_IOCTLDATA, buffer);
 #endif
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
-- 
2.0.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html