openssh: fix incompatible ptr type error GCC 14.1
authorSean Khan <datapronix@protonmail.com>
Fri, 5 Jul 2024 11:42:45 +0000 (07:42 -0400)
committerRosen Penev <rosenp@gmail.com>
Fri, 5 Jul 2024 20:41:33 +0000 (13:41 -0700)
The `ssh_systemd_notify` function is causing compilation errors
when built against GCC 14.1. This is due to an incompatible pointer
type being passed to the connect function.

The connect function expects a pointer to `struct sockaddr`, but
was receiving a pointer to `struct sockaddr_un`.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
net/openssh/Makefile
net/openssh/patches/100-fix-incompatible-ptr-GCC-14.1.patch [new file with mode: 0644]

index 40d2f2e1e105705837585c7009541e9f716ad4d9..5a5550143fc3b3ff8a1b1e7206fba14131d8df57 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssh
 PKG_VERSION:=9.8p1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \
diff --git a/net/openssh/patches/100-fix-incompatible-ptr-GCC-14.1.patch b/net/openssh/patches/100-fix-incompatible-ptr-GCC-14.1.patch
new file mode 100644 (file)
index 0000000..df0a6af
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/openbsd-compat/port-linux.c
++++ b/openbsd-compat/port-linux.c
+@@ -366,7 +366,7 @@ ssh_systemd_notify(const char *fmt, ...)
+               error_f("socket \"%s\": %s", path, strerror(errno));
+               goto out;
+       }
+-      if (connect(fd, &addr, sizeof(addr)) != 0) {
++      if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
+               error_f("socket \"%s\" connect: %s", path, strerror(errno));
+               goto out;
+       }