Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] openssh: fix broken gssapi on musl
@ 2022-11-09 14:37 klarasm
  2022-11-09 16:05 ` dkwo
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 14:37 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
@ 2022-11-09 16:05 ` dkwo
  2022-11-09 16:54 ` klarasm
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dkwo @ 2022-11-09 16:05 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1308988171

Comment:
have you seen the similar patch on alpine https://git.alpinelinux.org/aports/tree/main/openssh/gss-serv.c.patch ?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
  2022-11-09 16:05 ` dkwo
@ 2022-11-09 16:54 ` klarasm
  2022-11-09 17:23 ` klarasm
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 16:54 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309052406

Comment:
I had not seen that, seems to be the same issue. Can try to make that work but it seemed to break on crosscompilation with xbps-src.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
  2022-11-09 16:05 ` dkwo
  2022-11-09 16:54 ` klarasm
@ 2022-11-09 17:23 ` klarasm
  2022-11-09 17:26 ` klarasm
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 17:23 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309090517

Comment:
The patch using sys/param.h fails with this:
```
=> openssh-9.1p1_2: installing host dependencies: automake-1.16.5_1 ...
=> openssh-9.1p1_2: installing target dependencies: libedit-devel-20221009.3.1_1 pam-devel-1.5.2_2 zlib-devel-1.2.13_1 mit-krb5-devel-1.18.3_2 libldns-devel-1.8.3_1 openssl-devel-1.1.1s_1 libfido2-devel-1.12.0_1 musl-devel-1.1.24_10 ...
=> openssh-9.1p1_2: removing autodeps, please wait...
=> openssh-9.1p1_2: removing autocrossdeps, please wait...
=> ERROR: openssh-9.1p1_2: failed to install target dependencies! (error 8)
libdb-cxx-5.3.28_8: broken, unresolvable shlib `libgcc_s.so.1'
libdb-cxx-5.3.28_8: broken, unresolvable shlib `libstdc++.so.6'
Transaction aborted due to unresolved shlibs.
=> ERROR: Please see above for the real error, exiting...
```

`libdb-cxx` seems to be pulled in by `db-devel` which is pulled in by `libldap-devel` which is pulled in by `mit-krb5-devel`. If I add `musl-devel` to the patch using `gssrpc/types.h` it fails with the same message. So it seems to be some conflict in crosscompilation between a dependency of `mit-krb5-devel` and `musl-devel.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (2 preceding siblings ...)
  2022-11-09 17:23 ` klarasm
@ 2022-11-09 17:26 ` klarasm
  2022-11-09 17:26 ` klarasm
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 17:26 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309090517

Comment:
The patch using sys/param.h fails with this (on https://github.com/klarasm/void-packages/tree/openssh-gssapi-v1):
```
=> openssh-9.1p1_2: installing host dependencies: automake-1.16.5_1 ...
=> openssh-9.1p1_2: installing target dependencies: libedit-devel-20221009.3.1_1 pam-devel-1.5.2_2 zlib-devel-1.2.13_1 mit-krb5-devel-1.18.3_2 libldns-devel-1.8.3_1 openssl-devel-1.1.1s_1 libfido2-devel-1.12.0_1 musl-devel-1.1.24_10 ...
=> openssh-9.1p1_2: removing autodeps, please wait...
=> openssh-9.1p1_2: removing autocrossdeps, please wait...
=> ERROR: openssh-9.1p1_2: failed to install target dependencies! (error 8)
libdb-cxx-5.3.28_8: broken, unresolvable shlib `libgcc_s.so.1'
libdb-cxx-5.3.28_8: broken, unresolvable shlib `libstdc++.so.6'
Transaction aborted due to unresolved shlibs.
=> ERROR: Please see above for the real error, exiting...
```

`libdb-cxx` seems to be pulled in by `db-devel` which is pulled in by `libldap-devel` which is pulled in by `mit-krb5-devel`. If I add `musl-devel` to the patch using `gssrpc/types.h` it fails with the same message. So it seems to be some conflict in crosscompilation between a dependency of `mit-krb5-devel` and `musl-devel.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (3 preceding siblings ...)
  2022-11-09 17:26 ` klarasm
@ 2022-11-09 17:26 ` klarasm
  2022-11-09 17:47 ` klarasm
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 17:26 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309090517

Comment:
The patch using sys/param.h fails with this (on https://github.com/klarasm/void-packages/tree/openssh-gssapi-v1):
```
=> openssh-9.1p1_2: installing host dependencies: automake-1.16.5_1 ...
=> openssh-9.1p1_2: installing target dependencies: libedit-devel-20221009.3.1_1 pam-devel-1.5.2_2 zlib-devel-1.2.13_1 mit-krb5-devel-1.18.3_2 libldns-devel-1.8.3_1 openssl-devel-1.1.1s_1 libfido2-devel-1.12.0_1 musl-devel-1.1.24_10 ...
=> openssh-9.1p1_2: removing autodeps, please wait...
=> openssh-9.1p1_2: removing autocrossdeps, please wait...
=> ERROR: openssh-9.1p1_2: failed to install target dependencies! (error 8)
libdb-cxx-5.3.28_8: broken, unresolvable shlib `libgcc_s.so.1'
libdb-cxx-5.3.28_8: broken, unresolvable shlib `libstdc++.so.6'
Transaction aborted due to unresolved shlibs.
=> ERROR: Please see above for the real error, exiting...
```

`libdb-cxx` seems to be pulled in by `db-devel` which is pulled in by `libldap-devel` which is pulled in by `mit-krb5-devel`. If I add `musl-devel` to the patch using `gssrpc/types.h` it fails with the same message. So it seems to be some conflict in crosscompilation between a dependency of `mit-krb5-devel` and `musl-devel`.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (4 preceding siblings ...)
  2022-11-09 17:26 ` klarasm
@ 2022-11-09 17:47 ` klarasm
  2022-11-09 17:54 ` klarasm
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 17:47 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309118732

Comment:
Seems I didn't need to have `musl-devel` in the makedepends (maybe it's included by default), the package builds with crosscompilation if I remove it.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (5 preceding siblings ...)
  2022-11-09 17:47 ` klarasm
@ 2022-11-09 17:54 ` klarasm
  2022-11-09 18:25 ` klarasm
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 17:54 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309130139

Comment:
I spoke too soon. It now fails to build natively on x86-64_musl. Maybe could only include `musl-devel` if it's built natively on musl.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (6 preceding siblings ...)
  2022-11-09 17:54 ` klarasm
@ 2022-11-09 18:25 ` klarasm
  2022-11-09 19:27 ` dkwo
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 18:25 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309188970

Comment:
I added
```
               if [ -z "$CROSS_BUILD" ]; then
                       makedepends+=" $(vopt_if gssapi musl-devel)"
               fi
```
to the template of version 1 so it only includes `musl-devel` when building natively for musl. It builds both natively and crosscompiled with this, but the crosscompiled version just fails silently (tested on rpi1).

I also retested the crosscompiled version 2 (this PR) which still works.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (7 preceding siblings ...)
  2022-11-09 18:25 ` klarasm
@ 2022-11-09 19:27 ` dkwo
  2022-11-09 20:00 ` klarasm
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dkwo @ 2022-11-09 19:27 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309253327

Comment:
Strange, I'd expect that musl-devel is pulled in automatically when needed.
Perhaps Alpine does not test crosscompilation, so your patch might be better.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (8 preceding siblings ...)
  2022-11-09 19:27 ` dkwo
@ 2022-11-09 20:00 ` klarasm
  2022-11-09 20:35 ` dkwo
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 20:00 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309296114

Comment:
I retested version 1 (crosscompiled) again and it seems to work now but had to use `sv x sshd` again for it to restart properly. I probably just missed something last time :/

So both versions seem to work now and I could update this PR to version 1 if that's preferred. It would probably be good to have more testing though.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (9 preceding siblings ...)
  2022-11-09 20:00 ` klarasm
@ 2022-11-09 20:35 ` dkwo
  2022-11-09 20:46 ` klarasm
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 15+ messages in thread
From: dkwo @ 2022-11-09 20:35 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309344875

Comment:
The v1 builds fine here (x86_64 and aarch64) and crosscompiles fine `./xbps-src -m masterdir-x86_64/ -a x86_64-musl -o gssapi pkg openssh` without adding `musl-devel`. Maybe you need to force rebuild or delete some files?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (10 preceding siblings ...)
  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
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 20:46 UTC (permalink / raw)
  To: ml

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

New comment by klarasm on void-packages repository

https://github.com/void-linux/void-packages/pull/40414#issuecomment-1309355929

Comment:
That did it. After running `./xbps-src zap` and rebootstrapping it builds fine on x86_64-musl without `musl-devel`. I must have had something polluting the masterdir. Will run a few more tests, and if nothing else turns up I'll update this PR to version 1 instead.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Updated] openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (11 preceding siblings ...)
  2022-11-09 20:46 ` klarasm
@ 2022-11-09 21:22 ` klarasm
  2022-11-10  1:45 ` [PR PATCH] [Merged]: " sgn
  13 siblings, 0 replies; 15+ messages in thread
From: klarasm @ 2022-11-09 21:22 UTC (permalink / raw)
  To: ml

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

There is an updated 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: 1382 bytes --]

From 7a422d0e100eb618eb89ec54e01554f46e005736 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..a0ac6dceb08f
--- /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 <sys/param.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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PR PATCH] [Merged]: openssh: fix broken gssapi on musl
  2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
                   ` (12 preceding siblings ...)
  2022-11-09 21:22 ` [PR PATCH] [Updated] " klarasm
@ 2022-11-10  1:45 ` sgn
  13 siblings, 0 replies; 15+ messages in thread
From: sgn @ 2022-11-10  1:45 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

openssh: fix broken gssapi on musl
https://github.com/void-linux/void-packages/pull/40414

Description:
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)

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-11-10  1:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 14:37 [PR PATCH] openssh: fix broken gssapi on musl klarasm
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

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).