summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/util-linux
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-07-12 10:44:11 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-17 14:01:39 +0100
commit3ae1f267d4fd887e6b7039cada73b5de034a846d (patch)
treee3073a85212b49943e7d96e8c440befa45abaa07 /meta/recipes-core/util-linux
parenta731d879a79d9abf47b7a3f541f9c1b011f732e1 (diff)
downloadpoky-3ae1f267d4fd887e6b7039cada73b5de034a846d.tar.gz
util-linux: fix "su -" and package su separately
"su -" == "su --login" was broken because it uses /etc/pam.d/su-l and lacking that, falls back to /etc/pam.d/other which denies the operation. The fix is to symlink "su-l" to the normal "su" pam config file. Because "su" usually comes from "shadow" and has been broken like this without anyone noticing, it probably is not used much and thus should be packaged separately so that it can be installed only when really needed. For backwards compatibility, "util-linux" still pulls it in. It is a bit strange that DISTRO_FEATURES are getting checked when deciding whether the packages should be defined. It is not wrong, the packages will be simply empty and thus probably not created when the distro feature is on and the package config is off. Perhaps there is a reason, so this is kept unchanged. The symlink however only gets created when su.util-linux really gets built. [YOCTO #11126] (From OE-Core rev: 1ad32536c2d4a3e55e698d27d827caee788cb0f7) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/util-linux')
-rw-r--r--meta/recipes-core/util-linux/util-linux.inc13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 1656e92a87..47c2839970 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -35,7 +35,7 @@ PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfd
35 util-linux-partx util-linux-hwclock util-linux-mountpoint \ 35 util-linux-partx util-linux-hwclock util-linux-mountpoint \
36 util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit" 36 util-linux-findfs util-linux-getopt util-linux-sulogin util-linux-prlimit"
37PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}" 37PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
38PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser', '', d)}" 38PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
39 39
40PACKAGES_DYNAMIC = "^util-linux-lib.*" 40PACKAGES_DYNAMIC = "^util-linux-lib.*"
41 41
@@ -91,6 +91,8 @@ FILES_util-linux-findfs = "${sbindir}/findfs"
91FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}" 91FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
92FILES_util-linux-runuser = "${sbindir}/runuser" 92FILES_util-linux-runuser = "${sbindir}/runuser"
93FILES_util-linux-prlimit = "${bindir}/prlimit" 93FILES_util-linux-prlimit = "${bindir}/prlimit"
94FILES_util-linux-su = "${bindir}/su.util-linux ${sysconfdir}/pam.d/su-l"
95CONFFILES_util-linux-su = "${sysconfdir}/pam.d/su-l"
94 96
95FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \ 97FILES_util-linux-pylibmount = "${PYTHON_SITEPACKAGES_DIR}/libmount/pylibmount.so \
96 ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \ 98 ${PYTHON_SITEPACKAGES_DIR}/libmount/__init__.* \
@@ -116,9 +118,10 @@ RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
116RDEPENDS_util-linux-reset += "ncurses" 118RDEPENDS_util-linux-reset += "ncurses"
117 119
118RDEPENDS_util-linux-runuser += "libpam" 120RDEPENDS_util-linux-runuser += "libpam"
121RDEPENDS_util-linux-su += "libpam"
119 122
120RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk" 123RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin util-linux-lsblk"
121RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser', '', d)}" 124RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser util-linux-su', '', d)}"
122 125
123RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit" 126RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs util-linux-mountpoint util-linux-prlimit"
124 127
@@ -182,6 +185,12 @@ do_install () {
182 install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser 185 install -m 0644 ${WORKDIR}/runuser.pamd ${D}${sysconfdir}/pam.d/runuser
183 install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l 186 install -m 0644 ${WORKDIR}/runuser-l.pamd ${D}${sysconfdir}/pam.d/runuser-l
184 fi 187 fi
188 if [ "${@bb.utils.filter('PACKAGECONFIG', 'pam', d)}" ]; then
189 # Required for "su -" aka "su --login" because
190 # otherwise it uses "other", which has "auth pam_deny.so"
191 # and thus prevents the operation.
192 ln -s su ${D}${sysconfdir}/pam.d/su-l
193 fi
185} 194}
186 195
187# reset and nologin causes a conflict with ncurses-native and shadow-native 196# reset and nologin causes a conflict with ncurses-native and shadow-native