Skip to content

Commit 4237352

Browse files
authored
Merge pull request JuliaLang#45770 from JuliaLang/sf/fix_source_build
Fix `libgit2-hostkey.patch` for source build
2 parents fe9ac99 + 09f608c commit 4237352

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

deps/patches/libgit2-hostkey.patch

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
2-
index 471c3273ed..32189d0979 100644
2+
index 89f085230..b8bdca61a 100644
33
--- a/src/transports/ssh.c
44
+++ b/src/transports/ssh.c
5-
@@ -525,6 +525,7 @@ static int _git_ssh_setup_conn(
5+
@@ -467,6 +467,7 @@ static int _git_ssh_setup_conn(
66
git_credential *cred = NULL;
77
LIBSSH2_SESSION *session=NULL;
88
LIBSSH2_CHANNEL *channel=NULL;
99
+ char *host_and_port;
1010

1111
t->current_stream = NULL;
1212

13-
@@ -636,7 +637,15 @@ post_extract:
13+
@@ -567,10 +568,18 @@ static int _git_ssh_setup_conn(
1414

1515
cert_ptr = &cert;
1616

17-
- error = t->owner->certificate_check_cb((git_cert *) cert_ptr, 0, urldata.host, t->owner->message_cb_payload);
18-
+ if (atoi(urldata.port) == SSH_DEFAULT_PORT) {
19-
+ host_and_port = urldata.host;
17+
+ if (atoi(s->url.port) == SSH_DEFAULT_PORT) {
18+
+ host_and_port = s->url.host;
2019
+ } else {
21-
+ size_t n = strlen(urldata.host) + strlen(urldata.port) + 2;
20+
+ size_t n = strlen(s->url.host) + strlen(s->url.port) + 2;
2221
+ host_and_port = alloca(n);
23-
+ sprintf(host_and_port, "%s:%s", urldata.host, urldata.port);
22+
+ sprintf(host_and_port, "%s:%s", s->url.host, s->url.port);
2423
+ }
2524
+
26-
+ error = t->owner->certificate_check_cb((git_cert *) cert_ptr, 0, host_and_port, t->owner->message_cb_payload);
25+
error = t->owner->connect_opts.callbacks.certificate_check(
26+
(git_cert *)cert_ptr,
27+
0,
28+
- s->url.host,
29+
+ host_and_port,
30+
t->owner->connect_opts.callbacks.payload);
2731

2832
if (error < 0 && error != GIT_PASSTHROUGH) {
29-
if (!git_error_last())

0 commit comments

Comments
 (0)