Patchwork [master,dylan,v2] shadow: Fix build when DISTRO_FEATURES contains pam, libc-crypt

login
register
mail settings
Submitter Richard Tollerton
Date July 31, 2013, 6:33 p.m.
Message ID <1375295590-1887-1-git-send-email-rich.tollerton@ni.com>
Download mbox | patch
Permalink /patch/54885/
State Accepted
Commit 46e50e3703c822b4c2d7beb6873f3835274f4302
Headers show

Comments

Richard Tollerton - July 31, 2013, 6:33 p.m.
shadow falsely assumes that if --enable-libpam is set, it doesn't need to link
against libcrypt; this breaks chsh. (This same fix exists in Arch.)

Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>
---
 meta/recipes-extended/shadow/shadow_4.1.4.3.bb | 4 ++++
 1 file changed, 4 insertions(+)
Mark Hatle - Aug. 1, 2013, 11:21 p.m.
On 7/31/13 1:33 PM, Richard Tollerton wrote:
> shadow falsely assumes that if --enable-libpam is set, it doesn't need to link
> against libcrypt; this breaks chsh. (This same fix exists in Arch.)
>
> Signed-off-by: Richard Tollerton <rich.tollerton@ni.com>

This change is working for me.

Acked-by: Mark Hatle <mark.hatle@windriver.com>

> ---
>   meta/recipes-extended/shadow/shadow_4.1.4.3.bb | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
> index caf24c0..108e11e 100644
> --- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
> +++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
> @@ -37,6 +37,10 @@ EXTRA_OECONF += "--without-audit \
>                    --without-selinux"
>   EXTRA_OECONF_libc-uclibc += "--with-nscd=no"
>
> +# Build falsely assumes that if --enable-libpam is set, we don't need to link against
> +# libcrypt. This breaks chsh.
> +BUILD_LDFLAGS += "${@base_contains('DISTRO_FEATURES', 'pam', base_contains('DISTRO_FEATURES', 'libc-crypt',  '-lcrypt', '', d), '', d)}"
> +
>   PAM_PLUGINS = "libpam-runtime \
>                  pam-plugin-faildelay \
>                  pam-plugin-securetty \
>

Patch

diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
index caf24c0..108e11e 100644
--- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
+++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
@@ -37,6 +37,10 @@  EXTRA_OECONF += "--without-audit \
                  --without-selinux"
 EXTRA_OECONF_libc-uclibc += "--with-nscd=no"
 
+# Build falsely assumes that if --enable-libpam is set, we don't need to link against
+# libcrypt. This breaks chsh.
+BUILD_LDFLAGS += "${@base_contains('DISTRO_FEATURES', 'pam', base_contains('DISTRO_FEATURES', 'libc-crypt',  '-lcrypt', '', d), '', d)}"
+
 PAM_PLUGINS = "libpam-runtime \
                pam-plugin-faildelay \
                pam-plugin-securetty \