git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* http.receivepack==false && authenticated => Service not enabled
@ 2011-05-11 10:21 Robert
  2011-05-11 10:26 ` Robert
  0 siblings, 1 reply; 2+ messages in thread
From: Robert @ 2011-05-11 10:21 UTC (permalink / raw)
  To: git

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: http.receivepack==false && authenticated => Service not enabled
  2011-05-11 10:21 http.receivepack==false && authenticated => Service not enabled Robert
@ 2011-05-11 10:26 ` Robert
  0 siblings, 0 replies; 2+ messages in thread
From: Robert @ 2011-05-11 10:26 UTC (permalink / raw)
  To: git

Sorry!It is my wrong ! It is not a bug !

On Wed, May 11, 2011 at 10:21, Robert <yayooo@gmail.com> wrote:
> 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)
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-11 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-11 10:21 http.receivepack==false && authenticated => Service not enabled Robert
2011-05-11 10:26 ` Robert

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).