summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-01 12:08:55 +0200
committerAndreas Kling <kling@serenityos.org>2021-05-01 12:40:12 +0200
commite69b72973304cd22d446f4271022cc5311f61262 (patch)
tree0d6946d900947d10164c1816cd5ff6eb7f7e46d1 /Ports
parent17e5ba70b17f2751d1e6f640527b150df8c4e2ab (diff)
downloadserenity-e69b72973304cd22d446f4271022cc5311f61262.zip
Ports: Use sendfd()/recvfd() for mm_send_fd()/mm_receive_fd()
Diffstat (limited to 'Ports')
-rw-r--r--Ports/openssh/patches/scm-rights.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/Ports/openssh/patches/scm-rights.patch b/Ports/openssh/patches/scm-rights.patch
new file mode 100644
index 0000000000..cfbea83712
--- /dev/null
+++ b/Ports/openssh/patches/scm-rights.patch
@@ -0,0 +1,35 @@
+diff -Naur openssh-portable-9ca7e9c861775dd6c6312bc8aaab687403d24676/monitor_fdpass.c openssh-portable-9ca7e9c861775dd6c6312bc8aaab687403d24676.serenity/monitor_fdpass.c
+--- openssh-portable-9ca7e9c861775dd6c6312bc8aaab687403d24676/monitor_fdpass.c 2020-05-27 02:38:00.000000000 +0200
++++ openssh-portable-9ca7e9c861775dd6c6312bc8aaab687403d24676.serenity/monitor_fdpass.c 2021-05-01 12:32:21.145854477 +0200
+@@ -51,6 +51,7 @@
+ int
+ mm_send_fd(int sock, int fd)
+ {
++#ifndef __serenity__
+ #if defined(HAVE_SENDMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR))
+ struct msghdr msg;
+ #ifndef HAVE_ACCRIGHTS_IN_MSGHDR
+@@ -107,11 +108,15 @@
+ error("%s: file descriptor passing not supported", __func__);
+ return -1;
+ #endif
++#else
++ return sendfd(sock, fd);
++#endif
+ }
+
+ int
+ mm_receive_fd(int sock)
+ {
++#ifndef __serenity__
+ #if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR))
+ struct msghdr msg;
+ #ifndef HAVE_ACCRIGHTS_IN_MSGHDR
+@@ -184,4 +189,7 @@
+ error("%s: file descriptor passing not supported", __func__);
+ return -1;
+ #endif
++#else
++ return recvfd(sock, 0);
++#endif
+ }