Github messages for voidlinux
 help / color / mirror / Atom feed
From: klarasm <klarasm@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] openssh: fix broken gssapi on musl
Date: Wed, 09 Nov 2022 15:37:21 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40414@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 3323 bytes --]

There is a new pull request by klarasm against master on the void-packages repository

https://github.com/klarasm/void-packages openssh-gssapi-v2
https://github.com/void-linux/void-packages/pull/40414

openssh: fix broken gssapi on musl
I noticed that openssh does not build with gssapi option on musl (or crosscompiled from glibc). Seems it's complaining about missing definition `MAXHOSTNAMELEN` in `gss-serv.c`. in the headers included in `mit-krb5-devel` it's defined in `/usr/include/gssrpc/types.h` (also included in `musl-devel` in `/usr/include/sys/param.h` but using that the build fails crosscompiling from glibc complaining of unresolvable shlibs and `mit-krb5-devel` is already a makedepend with gssapi option).

Patching `#include <gssrpc/types.h>` into `gss-serv.c` seems to fix the problem both for native musl compile and crosscompiling from glibc. I also confirmed that compiling natively on glibc still works.

Don't know if there's an issue in the configure script that causes this, seems to be checking for `rpc/types.h`:
```
checking for rpc/types.h... no
```
which is similar to `gssrpc/types.h`. The configure script also contains mentions of `sys/param.h` but adding `musl-devel` to the makedepends without v1 patch does not fix it.

#### Testing the changes
- I tested the changes in this PR: **YES**

sshd main server instance seemed to crash after update on x86_64-musl and had to be restarted with `sv x sshd` (`sv t sshd` didn't seem to do anything). Don't know how much impact that would have as gssapi option is not enabled by default.
GSSAPI authentication seems to work from what I've tested with the patch.

The server crash on x86_64-musl could be unrelated but this should probably be tested by someone else anyway before merging to see if there's any other side-effects I've missed.

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-musl, x86_64-glibc)
- I built this PR locally for these architectures:
  - aarch64-musl
  - aarch64
  - armv6l-musl (tested on a rpi1, sshd seemed to restart properly with `sv t sshd`)
  - armv6l

Attaching logs from builds for reference (v1 is using /usr/include/sys/param.h from musl-devel):

[glibc-cross-x86_64-musl-no-patch.log](https://github.com/void-linux/void-packages/files/9971765/glibc-cross-x86_64-musl-no-patch.log)
[glibc-cross-x86_64-musl-v1-patch.log](https://github.com/void-linux/void-packages/files/9971766/glibc-cross-x86_64-musl-v1-patch.log)
[glibc-cross-x86_64-musl-v2-patch.log](https://github.com/void-linux/void-packages/files/9971767/glibc-cross-x86_64-musl-v2-patch.log)
[glibc-no-patch.log](https://github.com/void-linux/void-packages/files/9971768/glibc-no-patch.log)
[glibc-v1-patch.log](https://github.com/void-linux/void-packages/files/9971769/glibc-v1-patch.log)
[glibc-v2-patch.log](https://github.com/void-linux/void-packages/files/9971770/glibc-v2-patch.log)
[musl-no-patch.log](https://github.com/void-linux/void-packages/files/9971771/musl-no-patch.log)
[musl-v1-patch.log](https://github.com/void-linux/void-packages/files/9971772/musl-v1-patch.log)
[musl-v2-patch.log](https://github.com/void-linux/void-packages/files/9971773/musl-v2-patch.log)

A patch file from https://github.com/void-linux/void-packages/pull/40414.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-openssh-gssapi-v2-40414.patch --]
[-- Type: text/x-diff, Size: 1385 bytes --]

From 0ddeed0799b7b76b6ac2ab14b924cba6d9905682 Mon Sep 17 00:00:00 2001
From: Klara Modin <klarasmodin@gmail.com>
Date: Wed, 9 Nov 2022 13:34:13 +0100
Subject: [PATCH] openssh: fix broken gssapi on musl

---
 srcpkgs/openssh/patches/ssh-musl-gssapi.patch | 10 ++++++++++
 srcpkgs/openssh/template                      |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/openssh/patches/ssh-musl-gssapi.patch

diff --git a/srcpkgs/openssh/patches/ssh-musl-gssapi.patch b/srcpkgs/openssh/patches/ssh-musl-gssapi.patch
new file mode 100644
index 000000000000..7b9ea6ae8273
--- /dev/null
+++ b/srcpkgs/openssh/patches/ssh-musl-gssapi.patch
@@ -0,0 +1,10 @@
+--- a/gss-serv.c	2022-10-03 16:51:42.000000000 +0200
++++ b/gss-serv.c	2022-11-09 13:28:59.124968270 +0100
+@@ -33,6 +33,7 @@
+ #include <stdarg.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <gssrpc/types.h>
+ 
+ #include "openbsd-compat/sys-queue.h"
+ #include "xmalloc.h"
diff --git a/srcpkgs/openssh/template b/srcpkgs/openssh/template
index 9470b1ddf383..2eb9f32405e6 100644
--- a/srcpkgs/openssh/template
+++ b/srcpkgs/openssh/template
@@ -1,7 +1,7 @@
 # Template file for 'openssh'
 pkgname=openssh
 version=9.1p1
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--datadir=/usr/share/openssh
  --sysconfdir=/etc/ssh --without-selinux --with-privsep-user=nobody

             reply	other threads:[~2022-11-09 14:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 14:37 klarasm [this message]
2022-11-09 16:05 ` dkwo
2022-11-09 16:54 ` klarasm
2022-11-09 17:23 ` klarasm
2022-11-09 17:26 ` klarasm
2022-11-09 17:26 ` klarasm
2022-11-09 17:47 ` klarasm
2022-11-09 17:54 ` klarasm
2022-11-09 18:25 ` klarasm
2022-11-09 19:27 ` dkwo
2022-11-09 20:00 ` klarasm
2022-11-09 20:35 ` dkwo
2022-11-09 20:46 ` klarasm
2022-11-09 21:22 ` [PR PATCH] [Updated] " klarasm
2022-11-10  1:45 ` [PR PATCH] [Merged]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40414@inbox.vuxu.org \
    --to=klarasm@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).