git/list[1] front-page[2] threads[3] people[4] search[5] about
 

BUG in http-backend.c > http.receivepack

From
SSSpringer, Stephan <springer@sloman-neptun.com>
Date
Nov 24, 2014, 08:18 UTC
Message-ID
<F9AF62ADACFFBA47BEEADC5C12509F3401226EE8F8@Hermes.sns.local>
Hello Guys,

I found bug in http-backend.c with config-flag "http.receivepack"  You describe in our documentation: "This serves git send-pack clients, allowing push. It is disabled by default for anonymous users, and enabled by default for users authenticated by the web server. It can be disabled by setting this item to false, or enabled for all users, including anonymous users, by setting it to true." That cannot work, while svc-enable less than 0. See attachment

I tested with Centos 6.x,  Nginx 1.0.15 and Git 2.2.0-rc3 and Git 2.1.3
I hope you understand me and I don´t talk nonsense. My English a little rusty and this is my first bug report for open source project :-)  

Best regards Stephan Springer __________________________________________

SLOMAN NEPTUN Schiffahrts-Aktiengesellschaft
Langenstr. 44, 28195 Bremen / Germany
Telephone: ++49 (0) 421 1763 - 291
Telefax:   ++49 (0) 421 1763 - 400
E-Mail: springer@sloman-neptun.com
Page: www.sloman-neptun.com

Registergericht/Registered office: Amtsgericht Bremen (HRB 4046) Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Fritz Lütke-Uhlenbrock Vorstand / Board of Managing Directors: Sven-Michael Edye, Dirk Lohmann  __________________________________________

https://github.com/git/git/blob/master/http-backend.c
static void http_config(void)
{
        int i, value = 0;
        struct strbuf var = STRBUF_INIT;
        git_config_get_bool("http.getanyfile", &getanyfile);
        for (i = 0; i < ARRAY_SIZE(rpc_service); i++) {
               struct rpc_service *svc = &rpc_service[i];
               strbuf_addf(&var, "http.%s", svc->config_name);
               if (!git_config_get_bool(var.buf, &value))
                       svc->enabled = value;  <#### 1 or 0 
               strbuf_reset(&var);
        }
        strbuf_release(&var);
}
static struct rpc_service *select_service(const char *name)
{
        const char *svc_name;
        struct rpc_service *svc = NULL;
        int i;
        if (!skip_prefix(name, "git-", &svc_name))
               forbidden("Unsupported service: '%s'", name);
        for (i = 0; i < ARRAY_SIZE(rpc_service); i++) {
               struct rpc_service *s = &rpc_service[i];
               if (!strcmp(s->name, svc_name)) {
                       svc = s;
                       break;
               }
        }
        if (!svc)
               forbidden("Unsupported service: '%s'", name);
        #
        # better (svc->enabled <= 0) than can �REMOTE_USER� enable push function 
        #
        if (svc->enabled < 0) {        
               const char *user = getenv("REMOTE_USER");
               svc->enabled = (user && *user) ? 1 : 0;
        }
        if (!svc->enabled)
               forbidden("Service not enabled: '%s'", svc->name);
        return svc;
}
Next: Jeff King
Message 1 of 2 in “BUG in http-backend.c > http.receivepack”
  1. Springer, StephanNov 24, 2014
  2. Jeff KingNov 25, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.