threads / discuss / 27322

Re: http.receivepack==false && authenticated => Service not enabled

Subject: Re: http.receivepack==false && authenticated => Service not enabled

## tl;dr

2 messages between May 11, 2011 and May 11, 2011.

replies: 1people: 1as markdown or json

Robert· May 11, 2011, 10:21 UTC · lore

http.receivepack==false && authenticated => Service not enabled

Even a authenticated user can not push when http.receivepack set to false. when git config http.receivepack false svc->enabled was set to 0 not -1 so we should initialize with 0 not -1

--- http-backend.c Thu May 5 01:16:14 2011 +++ http-backend.c Wed May 11 09:57:52 2011

@@ -23,7 +23,7 @@

 static struct rpc_service rpc_service[] = {
        { "upload-pack", "uploadpack", 1 },
-       { "receive-pack", "receivepack", -1 },
+       { "receive-pack", "receivepack", 0 },
 };

 static struct string_list *get_parameters(void)
@@ -260,8 +260,8 @@
        if (!svc)
                forbidden("Unsupported service: '%s'", name);

-       if (svc->enabled < 0) {
                const char *user = getenv("REMOTE_USER");
+       if (!svc->enabled) {
                svc->enabled = (user && *user) ? 1 : 0;
        }
        if (!svc->enabled)
Robert· May 11, 2011, 10:26 UTC · re: Robert · lore
Sorry!It is my wrong ! It is not a bug !
On Wed, May 11, 2011 at 10:21, Robert <yayooo@gmail.com> wrote:
Show 28 quoted lines
> Even a authenticated  user can not push when http.receivepack set to false.
> when
> git config http.receivepack false
> svc->enabled was set to 0 not -1
> so we should initialize with 0 not -1
>
> --- http-backend.c      Thu May  5 01:16:14 2011
> +++ http-backend.c   Wed May 11 09:57:52 2011
> @@ -23,7 +23,7 @@
>
>  static struct rpc_service rpc_service[] = {
>        { "upload-pack", "uploadpack", 1 },
> -       { "receive-pack", "receivepack", -1 },
> +       { "receive-pack", "receivepack", 0 },
>  };
>
>  static struct string_list *get_parameters(void)
> @@ -260,8 +260,8 @@
>        if (!svc)
>                forbidden("Unsupported service: '%s'", name);
>
> -       if (svc->enabled < 0) {
>                const char *user = getenv("REMOTE_USER");
> +       if (!svc->enabled) {
>                svc->enabled = (user && *user) ? 1 : 0;
>        }
>        if (!svc->enabled)
>

← back to recent threads