diff options
Diffstat (limited to 'meta/recipes-extended/shadow/shadow_4.1.4.3.bb')
-rw-r--r-- | meta/recipes-extended/shadow/shadow_4.1.4.3.bb | 93 |
1 files changed, 2 insertions, 91 deletions
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 91ff24975d..6f1723ed6d 100644 --- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb +++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb | |||
@@ -1,99 +1,10 @@ | |||
1 | require shadow.inc | 1 | require shadow.inc |
2 | 2 | ||
3 | DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \ | ||
4 | shadow-native" | ||
5 | RDEPENDS_${PN} = "shadow-securetty ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)} \ | ||
6 | base-passwd" | ||
7 | PR = "r13" | ||
8 | |||
9 | SRC_URI += " \ | ||
10 | file://login_defs_pam.sed \ | ||
11 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \ | ||
12 | file://shadow-4.1.4.2-groupmod-pam-check.patch \ | ||
13 | file://shadow-4.1.4.2-su_no_sanitize_env.patch \ | ||
14 | file://shadow-update-pam-conf.patch \ | ||
15 | file://slackware_fix_for_glib-2.17_crypt.patch \ | ||
16 | file://fix-etc-gshadow-reading.patch \ | ||
17 | " | ||
18 | |||
19 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'pam', '--with-libpam', '--without-libpam', d)}" | ||
20 | EXTRA_OECONF_libc-uclibc += "--with-nscd=no" | ||
21 | |||
22 | # Build falsely assumes that if --enable-libpam is set, we don't need to link against | 3 | # Build falsely assumes that if --enable-libpam is set, we don't need to link against |
23 | # libcrypt. This breaks chsh. | 4 | # libcrypt. This breaks chsh. |
24 | BUILD_LDFLAGS += "${@base_contains('DISTRO_FEATURES', 'pam', base_contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}" | 5 | BUILD_LDFLAGS_append_class-target = " ${@base_contains('DISTRO_FEATURES', 'pam', base_contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}" |
25 | |||
26 | PAM_PLUGINS = "libpam-runtime \ | ||
27 | pam-plugin-faildelay \ | ||
28 | pam-plugin-securetty \ | ||
29 | pam-plugin-nologin \ | ||
30 | pam-plugin-env \ | ||
31 | pam-plugin-group \ | ||
32 | pam-plugin-limits \ | ||
33 | pam-plugin-lastlog \ | ||
34 | pam-plugin-motd \ | ||
35 | pam-plugin-mail \ | ||
36 | pam-plugin-shells \ | ||
37 | pam-plugin-rootok" | ||
38 | |||
39 | # Additional Policy files for PAM | ||
40 | PAM_SRC_URI = "file://pam.d/chfn \ | ||
41 | file://pam.d/chpasswd \ | ||
42 | file://pam.d/chsh \ | ||
43 | file://pam.d/login \ | ||
44 | file://pam.d/newusers \ | ||
45 | file://pam.d/passwd \ | ||
46 | file://pam.d/su" | ||
47 | |||
48 | do_install_append() { | ||
49 | # Ensure that the image has as a /var/spool/mail dir so shadow can | ||
50 | # put mailboxes there if the user reconfigures shadow to its | ||
51 | # defaults (see sed below). | ||
52 | install -d ${D}${localstatedir}/spool/mail | ||
53 | |||
54 | if [ -e ${WORKDIR}/pam.d ]; then | ||
55 | install -d ${D}${sysconfdir}/pam.d/ | ||
56 | install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/ | ||
57 | # Remove defaults that are not used when supporting PAM. | ||
58 | sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs | ||
59 | fi | ||
60 | |||
61 | install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} | ||
62 | |||
63 | # Move binaries to the locations we want | ||
64 | rm ${D}${sbindir}/vigr | ||
65 | ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr | ||
66 | if [ "${sbindir}" != "${base_sbindir}" ]; then | ||
67 | mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw | ||
68 | fi | ||
69 | if [ "${bindir}" != "${base_bindir}" ]; then | ||
70 | mv ${D}${bindir}/login ${D}${base_bindir}/login | ||
71 | mv ${D}${bindir}/su ${D}${base_bindir}/su | ||
72 | fi | ||
73 | |||
74 | # Handle link properly after rename, otherwise missing files would | ||
75 | # lead rpm failed dependencies. | ||
76 | ln -sf newgrp.${BPN} ${D}${bindir}/sg | ||
77 | } | ||
78 | |||
79 | inherit update-alternatives | ||
80 | 6 | ||
81 | ALTERNATIVE_PRIORITY = "200" | 7 | BBCLASSEXTEND = "native" |
82 | 8 | ||
83 | ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su" | ||
84 | ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd" | ||
85 | ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login" | ||
86 | ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw" | ||
87 | ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr" | ||
88 | ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su" | ||
89 | 9 | ||
90 | pkg_postinst_${PN} () { | ||
91 | if [ "x$D" != "x" ]; then | ||
92 | rootarg="--root=$D" | ||
93 | else | ||
94 | rootarg="" | ||
95 | fi | ||
96 | 10 | ||
97 | pwconv $rootarg | ||
98 | grpconv $rootarg | ||
99 | } | ||