]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Sync with 2.40.4
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 29 Oct 2024 23:27:52 +0000 (00:27 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 26 Nov 2024 21:14:57 +0000 (22:14 +0100)
* maint-2.40:
  Git 2.40.4
  credential: disallow Carriage Returns in the protocol by default
  credential: sanitize the user prompt
  credential_format(): also encode <host>[:<port>]
  t7300: work around platform-specific behaviour with long paths on MinGW
  compat/regex: fix argument order to calloc(3)
  mingw: drop bogus (and unneeded) declaration of `_pgmptr`
  ci: remove 'Upload failed tests' directories' step from linux32 jobs

1  2 
compat/mingw.c
credential.c
credential.h
strbuf.c
strbuf.h
t/t0300-credentials.sh
t/t5551-http-fetch-smart.sh
t/t7300-clean.sh

diff --cc compat/mingw.c
Simple merge
diff --cc credential.c
index 023b59d5711cf2fede0aa0408b47a1a6f64df059,b76a730901f5ea375670bc3f182394caed4d908d..70119cdae6b928d0af8507e5915fe9c15e2bea48
@@@ -8,9 -6,8 +8,9 @@@
  #include "url.h"
  #include "prompt.h"
  #include "sigchain.h"
 +#include "strbuf.h"
  #include "urlmatch.h"
--#include "git-compat-util.h"
++#include "environment.h"
  
  void credential_init(struct credential *c)
  {
@@@ -280,19 -283,16 +293,19 @@@ static void credential_write_item(cons
  
  void credential_write(const struct credential *c, FILE *fp)
  {
-       credential_write_item(fp, "protocol", c->protocol, 1);
-       credential_write_item(fp, "host", c->host, 1);
-       credential_write_item(fp, "path", c->path, 0);
-       credential_write_item(fp, "username", c->username, 0);
-       credential_write_item(fp, "password", c->password, 0);
-       credential_write_item(fp, "oauth_refresh_token", c->oauth_refresh_token, 0);
+       credential_write_item(c, fp, "protocol", c->protocol, 1);
+       credential_write_item(c, fp, "host", c->host, 1);
+       credential_write_item(c, fp, "path", c->path, 0);
+       credential_write_item(c, fp, "username", c->username, 0);
+       credential_write_item(c, fp, "password", c->password, 0);
++      credential_write_item(c, fp, "oauth_refresh_token", c->oauth_refresh_token, 0);
        if (c->password_expiry_utc != TIME_MAX) {
                char *s = xstrfmt("%"PRItime, c->password_expiry_utc);
-               credential_write_item(fp, "password_expiry_utc", s, 0);
+               credential_write_item(c, fp, "password_expiry_utc", s, 0);
                free(s);
        }
-               credential_write_item(fp, "wwwauth[]", c->wwwauth_headers.v[i], 0);
 +      for (size_t i = 0; i < c->wwwauth_headers.nr; i++)
++              credential_write_item(c, fp, "wwwauth[]", c->wwwauth_headers.v[i], 0);
  }
  
  static int run_credential_helper(struct credential *c,
diff --cc credential.h
index b8e2936d1dcb978d67fb6660c6ee288d9a26dfc5,2c0b39a925405fae99859d14f45da6e1c4e4d0cd..d35764c7bbf383a5f76c2d711695180b9bd75b9c
@@@ -148,7 -134,8 +150,9 @@@ struct credential 
  #define CREDENTIAL_INIT { \
        .helpers = STRING_LIST_INIT_DUP, \
        .password_expiry_utc = TIME_MAX, \
 +      .wwwauth_headers = STRVEC_INIT, \
+       .sanitize_prompt = 1, \
+       .protect_protocol = 1, \
  }
  
  /* Initialize a credential structure, setting all fields to empty. */
diff --cc strbuf.c
Simple merge
diff --cc strbuf.h
Simple merge
Simple merge
Simple merge
Simple merge