]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Git 2.26.2 v2.26.2
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 19 Apr 2020 23:32:24 +0000 (16:32 -0700)
committerJonathan Nieder <jrnieder@gmail.com>
Sun, 19 Apr 2020 23:32:24 +0000 (16:32 -0700)
This merges up the security fix from v2.17.5.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
1  2 
Documentation/RelNotes/2.26.2.txt
GIT-VERSION-GEN
RelNotes
credential.c
http.c
t/t0300-credentials.sh

index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..d434d0c695e425afb45daf290261faeacf4d52ca
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,5 @@@
++Git v2.26.2 Release Notes
++=========================
++
++This release merges the security fix that appears in v2.17.5; see
++the release notes for that version for details.
diff --cc GIT-VERSION-GEN
index a65cf74d93835f88c28e4ea5116aec03a3e7fb5c,77217e089748f0b92a88bc6e64f5f741fa9be6b4..dafe6d036aae4228726240f1d0a390e3ad03b517
@@@ -1,7 -1,7 +1,7 @@@
  #!/bin/sh
  
  GVF=GIT-VERSION-FILE
- DEF_VER=v2.26.1
 -DEF_VER=v2.25.4
++DEF_VER=v2.26.2
  
  LF='
  '
diff --cc RelNotes
index 9ccd8cad4355bfa4f2bf29ef6a3b107829116811,f579f9f817f741268a49a6a22d640f50f235cb92..3427be6818967d2d01521a64ffc1f88354290b6f
+++ b/RelNotes
@@@ -1,1 -1,1 +1,1 @@@
- Documentation/RelNotes/2.26.1.txt
 -Documentation/RelNotes/2.25.4.txt
++Documentation/RelNotes/2.26.2.txt
diff --cc credential.c
index 21b3ba152fe23f62d5a6e8d9e66065b43f53fe0a,cf11cc98f4f708a0ae2233085a2db4f086de77d1..108d9e183a5ddac0ccafca25d184cb94710ee9f5
@@@ -73,38 -87,16 +73,43 @@@ static int proto_is_http(const char *s
        return !strcmp(s, "https") || !strcmp(s, "http");
  }
  
 +static void credential_describe(struct credential *c, struct strbuf *out);
 +static void credential_format(struct credential *c, struct strbuf *out);
 +
 +static int select_all(const struct urlmatch_item *a,
 +                    const struct urlmatch_item *b)
 +{
 +      return 0;
 +}
 +
  static void credential_apply_config(struct credential *c)
  {
 +      char *normalized_url;
 +      struct urlmatch_config config = { STRING_LIST_INIT_DUP };
 +      struct strbuf url = STRBUF_INIT;
 +
+       if (!c->host)
+               die(_("refusing to work with credential missing host field"));
+       if (!c->protocol)
+               die(_("refusing to work with credential missing protocol field"));
        if (c->configured)
                return;
 -      git_config(credential_config_callback, c);
 +
 +      config.section = "credential";
 +      config.key = NULL;
 +      config.collect_fn = credential_config_callback;
 +      config.cascade_fn = NULL;
 +      config.select_fn = select_all;
 +      config.cb = c;
 +
 +      credential_format(c, &url);
 +      normalized_url = url_normalize(url.buf, &config.url);
 +
 +      git_config(urlmatch_config_entry, &config);
 +      free(normalized_url);
 +      strbuf_release(&url);
 +
        c->configured = 1;
  
        if (!c->use_http_path && proto_is_http(c->protocol)) {
diff --cc http.c
Simple merge
index 5b78ebbc3f223580e287889fd1d37e8cfb7bf724,6d44e7e5ccdb016a3d8c01ce930937c8a4354a16..5555a1524f1df58e640c4f2cc59e6c60a824d7f9
@@@ -397,32 -364,22 +472,42 @@@ test_expect_success 'http paths can be 
        EOF
  '
  
 +test_expect_success 'context uses urlmatch' '
 +      test_config "credential.https://*.org.useHttpPath" true &&
 +      check fill "verbatim foo bar" <<-\EOF
 +      protocol=https
 +      host=example.org
 +      path=foo.git
 +      --
 +      protocol=https
 +      host=example.org
 +      path=foo.git
 +      username=foo
 +      password=bar
 +      --
 +      verbatim: get
 +      verbatim: protocol=https
 +      verbatim: host=example.org
 +      verbatim: path=foo.git
 +      EOF
 +'
 +
  test_expect_success 'helpers can abort the process' '
        test_must_fail git \
-               -c credential.helper="!f() { echo quit=1; }; f" \
+               -c credential.helper=quit \
                -c credential.helper="verbatim foo bar" \
-               credential fill >stdout &&
-       test_must_be_empty stdout
+               credential fill >stdout 2>stderr <<-\EOF &&
+       protocol=http
+       host=example.com
+       EOF
+       test_must_be_empty stdout &&
+       cat >expect <<-\EOF &&
+       quit: get
+       quit: protocol=http
+       quit: host=example.com
+       fatal: credential helper '\''quit'\'' told us to quit
+       EOF
+       test_i18ncmp expect stderr
  '
  
  test_expect_success 'empty helper spec resets helper list' '