diff mbox series

[1/1] package/openssh: fix linux-pam select

Message ID 20240224213008.670294-1-fontaine.fabrice@gmail.com
State Changes Requested
Headers show
Series [1/1] package/openssh: fix linux-pam select | expand

Commit Message

Fabrice Fontaine Feb. 24, 2024, 9:30 p.m. UTC
Commit 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb forgot to handle
linux-pam dependencies resulting in the following build failure:

WARNING: unmet direct dependencies detected for BR2_PACKAGE_LINUX_PAM
  Depends on [n]: BR2_ENABLE_LOCALE [=n] && BR2_USE_WCHAR [=n] && !BR2_STATIC_LIBS [=y] && BR2_USE_MMU [=y] && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 [=y]
  Selected by [y]:
  - BR2_PACKAGE_OPENSSH [=y] && BR2_USE_MMU [=y] && BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION [=y]

WARNING: unmet direct dependencies detected for BR2_PACKAGE_LINUX_PAM
  Depends on [n]: BR2_ENABLE_LOCALE [=n] && BR2_USE_WCHAR [=n] && !BR2_STATIC_LIBS [=y] && BR2_USE_MMU [=y] && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 [=y]
  Selected by [y]:
  - BR2_PACKAGE_OPENSSH [=y] && BR2_USE_MMU [=y] && BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION [=y]

[...]

configure: error: in `/home/autobuild/autobuild/instance-12/output-1/build/linux-pam-1.6.0':
configure: error: failed to find dlopen

Fixes: 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb
 - http://autobuild.buildroot.org/results/c0aac8bed08850e07cb94f501d754c3c64cdfe07

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/openssh/Config.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Peter Korsgaard Feb. 25, 2024, 8:02 a.m. UTC | #1
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Commit 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb forgot to handle
 > linux-pam dependencies resulting in the following build failure:

 > WARNING: unmet direct dependencies detected for BR2_PACKAGE_LINUX_PAM
 >   Depends on [n]: BR2_ENABLE_LOCALE [=n] && BR2_USE_WCHAR [=n] && !BR2_STATIC_LIBS [=y] && BR2_USE_MMU [=y] && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 [=y]
 >   Selected by [y]:
 >   - BR2_PACKAGE_OPENSSH [=y] && BR2_USE_MMU [=y] && BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION [=y]

 > WARNING: unmet direct dependencies detected for BR2_PACKAGE_LINUX_PAM
 >   Depends on [n]: BR2_ENABLE_LOCALE [=n] && BR2_USE_WCHAR [=n] && !BR2_STATIC_LIBS [=y] && BR2_USE_MMU [=y] && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 [=y]
 >   Selected by [y]:
 >   - BR2_PACKAGE_OPENSSH [=y] && BR2_USE_MMU [=y] && BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION [=y]

 > [...]

 > configure: error: in `/home/autobuild/autobuild/instance-12/output-1/build/linux-pam-1.6.0':
 > configure: error: failed to find dlopen

 > Fixes: 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb
 >  - http://autobuild.buildroot.org/results/c0aac8bed08850e07cb94f501d754c3c64cdfe07

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 >  package/openssh/Config.in | 5 ++++-
 >  1 file changed, 4 insertions(+), 1 deletion(-)

 > diff --git a/package/openssh/Config.in b/package/openssh/Config.in
 > index a3038ba01f..c108569547 100644
 > --- a/package/openssh/Config.in
 > +++ b/package/openssh/Config.in
 > @@ -1,7 +1,10 @@
 >  config BR2_PACKAGE_OPENSSH
 >  	bool "openssh"
 >  	depends on BR2_USE_MMU # fork()
 > -	select BR2_PACKAGE_LINUX_PAM if BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION
 > +	select BR2_PACKAGE_LINUX_PAM if \
 > +		BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION && \
 > +		BR2_ENABLE_LOCALE && BR2_USE_WCHAR && \
 > +		!BR2_STATIC_LIBS && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9

This stops kconfig from complaining, but does a openssh + refpolicy build
without (E.G. ) locale support then actually work? Judging from:

commit 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb
Author: Adam Duskett <adam.duskett@amarulasolutions.com>
Date:   Mon Oct 9 16:34:40 2023 +0200

    package/openssh: select linux-pam if refpolicy upstream is selected

    linux-pam is required to login via OpenSSH if the upstream refpolicy for
    SELinux is enaabled, as linux-pam handles changing user contexts. If a
    user wants to make their own policy and use a refpolicy via git, we of course
    should let them do so. As such, only select linux-pam if the upstream version
    of refpolicy is selected.

I am not sure what the proper solution is for situations where pam is
not available? Adam?
Yann E. MORIN Feb. 25, 2024, 9:04 a.m. UTC | #2
Peter, Fabrice, All,

On 2024-02-25 09:02 +0100, Peter Korsgaard spake thusly:
> >>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
>  > Commit 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb forgot to handle
>  > linux-pam dependencies resulting in the following build failure:
[--SNIP--]
> This stops kconfig from complaining, but does a openssh + refpolicy build
> without (E.G. ) locale support then actually work? Judging from:
> commit 2c5a82a29ceb382d53ccb08ffd34a92c142cadbb
[--SNIP--]
> I am not sure what the proper solution is for situations where pam is
> not available? Adam?

I already sent a fix for this a while back, and we discussed it with
Thomas back at the last dev-days, summarised there:

    https://lore.kernel.org/buildroot/20240207122726.2aa4be3c@windsurf/

I'll need to send that new iteration soon...

Regards,
Yann E. MORIN.
diff mbox series

Patch

diff --git a/package/openssh/Config.in b/package/openssh/Config.in
index a3038ba01f..c108569547 100644
--- a/package/openssh/Config.in
+++ b/package/openssh/Config.in
@@ -1,7 +1,10 @@ 
 config BR2_PACKAGE_OPENSSH
 	bool "openssh"
 	depends on BR2_USE_MMU # fork()
-	select BR2_PACKAGE_LINUX_PAM if BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION
+	select BR2_PACKAGE_LINUX_PAM if \
+		BR2_PACKAGE_REFPOLICY_UPSTREAM_VERSION && \
+		BR2_ENABLE_LOCALE && BR2_USE_WCHAR && \
+		!BR2_STATIC_LIBS && BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
 	select BR2_PACKAGE_OPENSSL
 	select BR2_PACKAGE_ZLIB
 	help