summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-04-28 12:39:12 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-28 14:19:45 +0200
commitaa792062cbb0d39092948a7e71fad59737c4ac66 (patch)
tree09ff716195ccdaa7771f7188d2c9c77fd2183946 /Ports
parentc841012f569dba4fa72e9eb8989bb847be4535bc (diff)
downloadserenity-aa792062cbb0d39092948a7e71fad59737c4ac66.zip
Kernel+LibC: Implement the socketpair() syscall
Diffstat (limited to 'Ports')
-rw-r--r--Ports/libassuan/patches/socketpair.patch16
-rw-r--r--Ports/openssh/patches/missing_functionality.patch36
-rw-r--r--Ports/openssh/patches/sftp_pipes.patch16
-rw-r--r--Ports/stress-ng/patches/0003-missing-networking-functionality.patch15
4 files changed, 0 insertions, 83 deletions
diff --git a/Ports/libassuan/patches/socketpair.patch b/Ports/libassuan/patches/socketpair.patch
deleted file mode 100644
index 61d318bac4..0000000000
--- a/Ports/libassuan/patches/socketpair.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Naur libassuan-2.5.5/src/system-posix.c libassuan-2.5.5.serenity/src/system-posix.c
---- libassuan-2.5.5/src/system-posix.c 2021-04-14 02:40:14.020341296 +0200
-+++ libassuan-2.5.5.serenity/src/system-posix.c 2021-04-14 02:39:56.823341349 +0200
-@@ -412,7 +412,12 @@
- __assuan_socketpair (assuan_context_t ctx, int namespace, int style,
- int protocol, assuan_fd_t filedes[2])
- {
-+#ifndef __serenity__
- return socketpair (namespace, style, protocol, filedes);
-+#else
-+ errno = ENOTSUP;
-+ return -1;
-+#endif
- }
-
-
diff --git a/Ports/openssh/patches/missing_functionality.patch b/Ports/openssh/patches/missing_functionality.patch
index e4ba95fe6d..5c7cecf808 100644
--- a/Ports/openssh/patches/missing_functionality.patch
+++ b/Ports/openssh/patches/missing_functionality.patch
@@ -150,21 +150,6 @@ index 554ceb0b..67464ef2 100644
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
-diff --git a/monitor.c b/monitor.c
-index b6e855d5..bde8f383 100644
---- a/monitor.c
-+++ b/monitor.c
-@@ -1752,8 +1752,10 @@ monitor_openfds(struct monitor *mon, int do_logfds)
- int on = 1;
- #endif
-
-+#ifndef __serenity__
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
- fatal("%s: socketpair: %s", __func__, strerror(errno));
-+#endif
- #ifdef SO_ZEROIZE
- if (setsockopt(pair[0], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) == -1)
- error("setsockopt SO_ZEROIZE(0): %.100s", strerror(errno));
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 059b6d3b..2a248c81 100644
--- a/openbsd-compat/bsd-misc.c
@@ -588,27 +573,6 @@ index af08be41..9e748a23 100644
r = check_host_key(host, hostaddr, options.port, host_key, RDRW,
options.user_hostfiles, options.num_user_hostfiles,
options.system_hostfiles, options.num_system_hostfiles);
-diff --git a/sshd.c b/sshd.c
-index 6f8f11a3..1ecf3e32 100644
---- a/sshd.c
-+++ b/sshd.c
-@@ -1231,6 +1231,8 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
- continue;
- }
-
-+// FIXME: socketpair is seemingly required for SSHD to work, but doesn't current exist.
-+#ifndef __serenity__
- if (rexec_flag && socketpair(AF_UNIX,
- SOCK_STREAM, 0, config_s) == -1) {
- error("reexec socketpair: %s",
-@@ -1240,6 +1242,7 @@ server_accept_loop(int *sock_in, int *sock_out, int *newsock, int *config_s)
- close(startup_p[1]);
- continue;
- }
-+#endif
-
- for (j = 0; j < options.max_startups; j++)
- if (startup_pipes[j] == -1) {
diff --git a/sshkey.c b/sshkey.c
index 1571e3d9..2b5c611c 100644
--- a/sshkey.c
diff --git a/Ports/openssh/patches/sftp_pipes.patch b/Ports/openssh/patches/sftp_pipes.patch
deleted file mode 100644
index 10838cdc9d..0000000000
--- a/Ports/openssh/patches/sftp_pipes.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-e5a0b5cc530260b1ee94105e8c989ba21856b4a2 Use pipes instead of socketpair in SFTP
-diff --git a/sftp.c b/sftp.c
-index 2799e4a1..9ce7055a 100644
---- a/sftp.c
-+++ b/sftp.c
-@@ -2296,6 +2296,10 @@ interactive_loop(struct sftp_conn *conn, char *file1, char *file2)
- return (err >= 0 ? 0 : -1);
- }
-
-+#ifdef __serenity__
-+#define USE_PIPES 1
-+#endif
-+
- static void
- connect_to_server(char *path, char **args, int *in, int *out)
- {
diff --git a/Ports/stress-ng/patches/0003-missing-networking-functionality.patch b/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
index 792e2a6433..436d349bf9 100644
--- a/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
+++ b/Ports/stress-ng/patches/0003-missing-networking-functionality.patch
@@ -79,18 +79,3 @@ diff -ur a/stress-resources.c b/stress-resources.c
static const int types[] = { SOCK_STREAM, SOCK_DGRAM };
static stress_info_t info[MAX_LOOPS];
#if defined(O_NOATIME)
-@@ -309,11 +309,13 @@
- if (!keep_stressing_flag())
- break;
-
-+#if 0
- if (socketpair(AF_UNIX, SOCK_STREAM, 0,
- info[i].fd_socketpair) < 0) {
- info[i].fd_socketpair[0] = -1;
- info[i].fd_socketpair[1] = -1;
- }
-+#endif
-
- #if defined(HAVE_USERFAULTFD)
- info[i].fd_uf = shim_userfaultfd(0);
-d