diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/Manifest b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/Manifest index 0cc0147e82..000b8e7883 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/Manifest +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/Manifest @@ -1 +1 @@ -DIST shadow-4.5.tar.gz 3804933 SHA256 ed2d53bd0e80cf32261e82b8d93684334e8809266dba1ec7a42bfa747605989e SHA512 02d6482a1159689e404dd49a68b4e2db85e9ffdcdfbacc8efcbd9043f14a1ec3fc4d749700df915d375df67d589219b6b0f57a6cfd9fb5b197012888a608913b WHIRLPOOL 73552aff621cf34ef977095a05d9b679b7b6ffa78979d69eeb43089564aca5cc1d841dc9cbb6f0fba4c4f712f0e89f6cc683b733ea1041e4633b5d9fe58b5499 +DIST shadow-4.6.tar.gz 3804282 BLAKE2B 268c90e7daba138827aec6039f428f52cdcf7929743fa1f49f801cc669de7456ec5a69531194cdb29f051ce7d0b2f1e966fdf2513a9fc8f7fbdeb29d786a509f SHA512 36358333e7f03ef558772f3361bc5851a7d7fd3d85c993a6b732e37304b8068b2893d55607b9bfe8b8eed616a687264f947ff66cefc74ea1a48ba9396d464714 diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/securetty b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/securetty deleted file mode 100644 index c7042fae2c..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/securetty +++ /dev/null @@ -1,33 +0,0 @@ -# /etc/securetty: list of terminals on which root is allowed to login. -# See securetty(5) and login(1). -console - -vc/0 -vc/1 -vc/2 -vc/3 -vc/4 -vc/5 -vc/6 -vc/7 -vc/8 -vc/9 -vc/10 -vc/11 -vc/12 -tty0 -tty1 -tty2 -tty3 -tty4 -tty5 -tty6 -tty7 -tty8 -tty9 -tty10 -tty11 -tty12 - -tts/0 -ttyS0 diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/tmpfiles.d/etc-shadow.conf b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/tmpfiles.d/etc-shadow.conf deleted file mode 100644 index 0acaf6838a..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/tmpfiles.d/etc-shadow.conf +++ /dev/null @@ -1,5 +0,0 @@ -L /etc/login.defs - - - - ../usr/share/shadow/login.defs -L /etc/securetty - - - - ../usr/share/shadow/securetty - -d /etc/default - - - - - -L /etc/default/useradd - - - - ../../usr/share/shadow/useradd diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/tmpfiles.d/var-shadow.conf b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/tmpfiles.d/var-shadow.conf deleted file mode 100644 index 612187d6ae..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/files/tmpfiles.d/var-shadow.conf +++ /dev/null @@ -1 +0,0 @@ -f /var/log/faillog - - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/shadow-4.5-r1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/shadow-4.6.ebuild similarity index 63% rename from sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/shadow-4.5-r1.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/shadow-4.6.ebuild index 8662bbe977..2c4f91f2ec 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/shadow-4.5-r1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-apps/shadow/shadow-4.6.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -EAPI="5" +EAPI=6 -inherit eutils libtool pam multilib systemd +inherit libtool pam multilib DESCRIPTION="Utilities to deal with user accounts" HOMEPAGE="https://github.com/shadow-maint/shadow http://pkg-shadow.alioth.debian.org/" @@ -11,11 +11,10 @@ SRC_URI="https://github.com/shadow-maint/shadow/releases/download/${PV}/${P}.tar LICENSE="BSD GPL-2" SLOT="0" -KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="acl audit cracklib nls pam selinux skey xattr" +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86" +IUSE="acl audit +cracklib nls pam selinux skey xattr" # Taken from the man/Makefile.am file. LANGS=( cs da de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW ) -IUSE+=" $(printf 'linguas_%s ' ${LANGS[*]})" RDEPEND="acl? ( sys-apps/acl:0= ) audit? ( >=sys-process/audit-2.6:0= ) @@ -35,37 +34,39 @@ RDEPEND="${RDEPEND} pam? ( >=sys-auth/pambase-20150213 )" PATCHES=( - "${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch + "${FILESDIR}/${PN}-4.1.3-dots-in-usernames.patch" ) src_prepare() { - epatch "${PATCHES[@]}" - epatch_user + default #eautoreconf elibtoolize } src_configure() { - econf \ - --without-group-name-max-length \ - --without-tcb \ - --enable-shared=no \ - --enable-static=yes \ - $(use_with acl) \ - $(use_with audit) \ - $(use_with cracklib libcrack) \ - $(use_with pam libpam) \ - $(use_with skey) \ - $(use_with selinux) \ - $(use_enable nls) \ - $(use_with elibc_glibc nscd) \ + local myeconfargs=( + --without-group-name-max-length + --without-tcb + --enable-shared=no + --enable-static=yes + $(use_with acl) + $(use_with audit) + $(use_with cracklib libcrack) + $(use_with pam libpam) + $(use_with skey) + $(use_with selinux) + $(use_enable nls) + $(use_with elibc_glibc nscd) $(use_with xattr attr) + ) + econf "${myeconfargs[@]}" + has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052 if use nls ; then local l langs="po" # These are the pot files. for l in ${LANGS[*]} ; do - use linguas_${l} && langs+=" ${l}" + has ${l} ${LINGUAS-${l}} && langs+=" ${l}" done sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die fi @@ -77,14 +78,14 @@ set_login_opt() { comment="#" sed -i \ -e "/^${opt}\>/s:^:#:" \ - "${ED}"/usr/share/shadow/login.defs || die + "${ED%/}"/etc/login.defs || die else sed -i -r \ -e "/^#?${opt}\>/s:.*:${opt} ${val}:" \ - "${ED}"/usr/share/shadow/login.defs + "${ED%/}"/etc/login.defs fi - local res=$(grep "^${comment}${opt}\>" "${ED}"/usr/share/shadow/login.defs) - einfo "${res:-Unable to find ${opt} in /usr/share/shadow/login.defs}" + local res=$(grep "^${comment}${opt}\>" "${ED%/}"/etc/login.defs) + einfo "${res:-Unable to find ${opt} in /etc/login.defs}" } src_install() { @@ -95,41 +96,25 @@ src_install() { # Currently, libshadow.a is for internal use only, so if you see # -lshadow in a Makefile of some other package, it is safe to # remove it. - rm -f "${ED}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la} + rm -f "${ED%/}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la} - # Remove files from /etc, they will be symlinks to /usr instead. - rm -f "${ED}"/etc/{limits,login.access,login.defs,securetty,default/useradd} - - # CoreOS: break shadow.conf into two files so that we only have to apply - # etc-shadow.conf in the initrd. - systemd_dotmpfilesd "${FILESDIR}"/tmpfiles.d/etc-shadow.conf - systemd_dotmpfilesd "${FILESDIR}"/tmpfiles.d/var-shadow.conf - - insinto /usr/share/shadow - # Using a securetty with devfs device names added - # (compat names kept for non-devfs compatibility) - insopts -m0600 ; doins "${FILESDIR}"/securetty + insinto /etc if ! use pam ; then insopts -m0600 doins etc/login.access etc/limits fi - # Output arch-specific cruft - local devs - case $(tc-arch) in - ppc*) devs="hvc0 hvsi0 ttyPSC0";; - hppa) devs="ttyB0";; - arm) devs="ttyFB0 ttySAC0 ttySAC1 ttySAC2 ttySAC3 ttymxc0 ttymxc1 ttymxc2 ttymxc3 ttyO0 ttyO1 ttyO2";; - sh) devs="ttySC0 ttySC1";; - amd64|x86) devs="hvc0";; - esac - if [[ -n ${devs} ]]; then - printf '%s\n' ${devs} >> "${ED}"/usr/share/shadow/securetty - fi # needed for 'useradd -D' + insinto /etc/default insopts -m0600 doins "${FILESDIR}"/default/useradd + # move passwd to / to help recover broke systems #64441 + mv "${ED%/}"/usr/bin/passwd "${ED%/}"/bin/ || die + dosym ../../bin/passwd /usr/bin/passwd + + cd "${S}" || die + insinto /etc insopts -m0644 newins etc/login.defs login.defs @@ -182,27 +167,27 @@ src_install() { -e 'b exit' \ -e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \ -e ': exit' \ - "${ED}"/usr/share/shadow/login.defs || die + "${ED%/}"/etc/login.defs || die # remove manpages that pam will install for us # and/or don't apply when using pam - find "${ED}"/usr/share/man \ + find "${ED%/}"/usr/share/man \ '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \ -delete # Remove pam.d files provided by pambase. - rm "${ED}"/etc/pam.d/{login,passwd,su} || die + rm "${ED%/}"/etc/pam.d/{login,passwd,su} || die fi # Remove manpages that are handled by other packages - find "${ED}"/usr/share/man \ + find "${ED%/}"/usr/share/man \ '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \ -delete - cd "${S}" + cd "${S}" || die dodoc ChangeLog NEWS TODO newdoc README README.download - cd doc + cd doc || die dodoc HOWTO README* WISHLIST *.txt } @@ -210,3 +195,17 @@ pkg_preinst() { rm -f "${EROOT}"/etc/pam.d/system-auth.new \ "${EROOT}/etc/login.defs.new" } + +pkg_postinst() { + # Enable shadow groups. + if [ ! -f "${EROOT}"/etc/gshadow ] ; then + if grpck -r -R "${EROOT}" 2>/dev/null ; then + grpconv -R "${EROOT}" + else + ewarn "Running 'grpck' returned errors. Please run it by hand, and then" + ewarn "run 'grpconv' afterwards!" + fi + fi + + einfo "The 'adduser' symlink to 'useradd' has been dropped." +}