Ports: Update openssh's patches to use git patches

This commit is contained in:
Ali Mohammad Pur 2022-05-17 21:25:36 +04:30 committed by Ali Mohammad Pur
parent 7077ce7779
commit 6e5509183f
Notes: sideshowbarker 2024-07-18 04:38:32 +09:00
9 changed files with 177 additions and 21 deletions

View File

@ -1,4 +1,39 @@
Ifdef out unimplemented functionality
From 0eca70393610857e0a87f157698b295bd727dcae Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Sat, 30 Apr 2022 10:58:10 +0000
Subject: [PATCH 1/7] ifdef out missing functionality
Co-Authored-By: Luke <luke.wilde@live.co.uk>
Co-Authored-By: Patrick Meyer <git@the-space.agency>
Co-Authored-By: Tim Schumacher <timschumi@gmx.de>
---
atomicio.c | 2 +-
defines.h | 5 +++++
dns.c | 4 ++++
dns.h | 4 ++++
hostfile.c | 2 ++
includes.h | 2 ++
loginrec.c | 8 ++++----
misc.c | 2 ++
openbsd-compat/getrrsetbyname-ldns.c | 4 ++++
openbsd-compat/getrrsetbyname.c | 4 ++++
openbsd-compat/getrrsetbyname.h | 4 ++++
openbsd-compat/mktemp.c | 2 +-
readconf.c | 5 ++++-
regress/netcat.c | 2 ++
sandbox-pledge.c | 2 ++
servconf.c | 2 ++
ssh-add.c | 4 ++++
ssh-agent.c | 2 ++
ssh-keygen.c | 11 +++++++++++
ssh-keyscan.c | 2 ++
ssh-pkcs11-client.c | 8 +++++++-
ssh-sk-client.c | 4 ++++
sshbuf-misc.c | 2 ++
sshconnect.c | 10 ++++++++--
sshkey.c | 4 ++++
25 files changed, 91 insertions(+), 10 deletions(-)
diff --git a/atomicio.c b/atomicio.c
index 7650733..7a195f5 100644
--- a/atomicio.c
@ -590,3 +625,6 @@ index f1e9200..564ff40 100644
#ifdef WITH_XMSS
case KEY_XMSS:
case KEY_XMSS_CERT:
--
2.36.1

View File

@ -0,0 +1,27 @@
From 352c627e3896ed1305826a1fa2ece85a70e66fd7 Mon Sep 17 00:00:00 2001
From: Luke <luke.wilde@live.co.uk>
Date: Sat, 26 Sep 2020 08:12:27 -0700
Subject: [PATCH 2/7] Add a missing stdio.h include
---
openbsd-compat/bsd-flock.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/openbsd-compat/bsd-flock.c b/openbsd-compat/bsd-flock.c
index 9b15d1e..bf57389 100644
--- a/openbsd-compat/bsd-flock.c
+++ b/openbsd-compat/bsd-flock.c
@@ -40,6 +40,10 @@
#include <errno.h>
#include <fcntl.h>
+#ifdef __serenity__
+#include <stdio.h>
+#endif
+
int
flock(int fd, int op)
{
--
2.36.1

View File

@ -1,4 +1,14 @@
Add missing sigaction pledges and remove dns
From fc2d9a37e6b20ed4544fcb53c25bd34c1c3f2249 Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Sat, 30 Apr 2022 10:58:10 +0000
Subject: [PATCH 3/7] Fix pledges to conform to serenity's pledge()
Co-Authored-By: Patrick Meyer <git@the-space.agency>
---
clientloop.c | 10 +++++-----
ssh-keysign.c | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/clientloop.c b/clientloop.c
index f8350e6..00bf4b6 100644
--- a/clientloop.c
@ -62,3 +72,6 @@ index c52321e..9ae4dbf 100644
fatal("%s: pledge: %s", __progname, strerror(errno));
for (i = found = 0; i < NUM_KEYTYPES; i++) {
--
2.36.1

View File

@ -1,4 +1,14 @@
Remove inet_aton redefinition
From 5f5cc486c5de5e03aa2397431e881e356f94724f Mon Sep 17 00:00:00 2001
From: Luke <luke.wilde@live.co.uk>
Date: Sat, 30 Apr 2022 10:58:10 +0000
Subject: [PATCH 4/7] Remove inet_aton() redefinition
Co-Authored-By: Patrick Meyer <git@the-space.agency>
---
openbsd-compat/inet_aton.c | 172 ++++++++++++++++----------------
openbsd-compat/openbsd-compat.h | 2 +-
2 files changed, 87 insertions(+), 87 deletions(-)
diff --git a/openbsd-compat/inet_aton.c b/openbsd-compat/inet_aton.c
index 5efcc5f..14aa47b 100644
--- a/openbsd-compat/inet_aton.c
@ -207,3 +217,6 @@ index 4316ab8..1c5c338 100644
int inet_aton(const char *cp, struct in_addr *addr);
#endif
--
2.36.1

View File

@ -1,4 +1,13 @@
%.100s and sscanf doesn't work as expected
From e7f883a58ee451a086a5f6262cbad323f3af6023 Mon Sep 17 00:00:00 2001
From: Luke <luke.wilde@live.co.uk>
Date: Sat, 30 Apr 2022 10:58:10 +0000
Subject: [PATCH 5/7] Assume SSH 2.0 and sidestep some scanf issues
Co-Authored-By: Patrick Meyer <git@the-space.agency>
---
kex.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/kex.c b/kex.c
index 0bcd27d..2539cc2 100644
--- a/kex.c
@ -49,3 +58,6 @@ index 0bcd27d..2539cc2 100644
debug("Remote protocol version %d.%d, remote software version %.100s",
remote_major, remote_minor, remote_version);
compat_banner(ssh, remote_version);
--
2.36.1

View File

@ -1,5 +1,15 @@
From 80b391147785edcbf2e1267104e24087ffb420df Mon Sep 17 00:00:00 2001
From: Gunnar Beutner <gbeutner@serenityos.org>
Date: Sat, 30 Apr 2022 10:58:10 +0000
Subject: [PATCH 6/7] Use sendfd/recvfd on serenity
Co-Authored-By: Patrick Meyer <git@the-space.agency>
---
monitor_fdpass.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index a07727a..0a9fe75 100644
index a07727a..ad6774e 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -51,6 +51,7 @@
@ -34,3 +44,6 @@ index a07727a..0a9fe75 100644
+ return recvfd(sock, 0);
+#endif
}
--
2.36.1

View File

@ -1,3 +1,12 @@
From ba3aaa65905f77e6e8bb812ca0ddcdba4f3c0eb3 Mon Sep 17 00:00:00 2001
From: Patrick Meyer <git@the-space.agency>
Date: Sat, 30 Apr 2022 10:58:10 +0000
Subject: [PATCH 7/7] Use unveil for privsep
---
sshd.c | 28 +++-------------------------
1 file changed, 3 insertions(+), 25 deletions(-)
diff --git a/sshd.c b/sshd.c
index 0ee65b5..e2f84de 100644
--- a/sshd.c
@ -44,3 +53,6 @@ index 0ee65b5..e2f84de 100644
if (test_flag > 1) {
/*
* If no connection info was provided by -C then use
--
2.36.1

View File

@ -0,0 +1,44 @@
# Patches for openssh on SerenityOS
## `0001-ifdef-out-missing-functionality.patch`
ifdef out missing functionality
## `0002-Add-a-missing-stdio.h-include.patch`
Add a missing stdio.h include
## `0003-Fix-pledges-to-conform-to-serenity-s-pledge.patch`
Fix pledges to conform to serenity's pledge()
## `0004-Remove-inet_aton-redefinition.patch`
Remove inet_aton() redefinition
## `0005-Assume-SSH-2.0-and-sidestep-some-scanf-issues.patch`
Assume SSH 2.0 and sidestep some scanf issues
## `0006-Use-sendfd-recvfd-on-serenity.patch`
Use sendfd/recvfd on serenity
## `0007-Use-unveil-for-privsep.patch`
Use unveil for privsep

View File

@ -1,16 +0,0 @@
87fc789d2db19db2a65cbf45b53afde5722ad1af Add missing stdio include in bsd-flock
diff --git a/openbsd-compat/bsd-flock.c b/openbsd-compat/bsd-flock.c
index 9b15d1ea..bf57389a 100644
--- a/openbsd-compat/bsd-flock.c
+++ b/openbsd-compat/bsd-flock.c
@@ -40,6 +40,10 @@
#include <errno.h>
#include <fcntl.h>
+#ifdef __serenity__
+#include <stdio.h>
+#endif
+
int
flock(int fd, int op)
{