mirror of
https://github.com/flatcar/scripts.git
synced 2025-10-01 02:22:11 +02:00
sys-apps/shadow: Sync with Gentoo upstream; updates to 4.12.3
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
This commit is contained in:
parent
9d7775af3d
commit
ecf9249a70
@ -1 +1,2 @@
|
||||
DIST shadow-4.11.1.tar.xz 1656584 BLAKE2B d459a1e0ffb342b6b455caf65e6af60b32eee72d4a9b1ab126485fb4632503a42061d3f0b960554c8155af6dc0564c585335b27aecca6538b394a0d58d927588 SHA512 12fbe4d6ac929ad3c21525ed0f1026b5b678ccec9762f2ec7e611d9c180934def506325f2835fb750dd30af035b592f827ff151cd6e4c805aaaf8e01425c279f
|
||||
DIST shadow-4.12.3.tar.xz 1747620 BLAKE2B 63b10d75a11d419156a996b8acf1bebbfab28999c2ab796e6625c028882073d4021806d8b56224190886c076a1205955e7797cb6f797ef73af3a8a33ac34bf2f SHA512 0529889258f54e7634762dc154aa680d55f8c5f1654afadd1b7431cfbb890a3b1ba27c7ff4b7c45986e4ee2289946db2e420b23ed13e4e5b15800a1fb3a013bc
|
||||
DIST shadow-4.12.3.tar.xz.asc 488 BLAKE2B b23525c3303f78df9d046c0225ed3ee1715cb000650630daae8b41fb71413daa45b5fe39a98fc640aaafa0f219fbaf9e065afa6b44f051373fb1967358ccc43d SHA512 d3f294d86c0e2174c88809810a801737c01cd01f9cadbe7b1ae382b2745d86e2e30c0718fa6489c2abb65500ed94c8ac1961d05243b5a1800c966384c69281c9
|
||||
|
@ -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
|
@ -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
|
@ -1 +0,0 @@
|
||||
f /var/log/faillog - - - - -
|
@ -1,29 +1,26 @@
|
||||
# Copyright 1999-2022 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
EAPI=8
|
||||
|
||||
TMPFILES_OPTIONAL=1
|
||||
inherit libtool pam systemd tmpfiles
|
||||
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/sergehallyn.asc
|
||||
inherit libtool pam verify-sig
|
||||
|
||||
DESCRIPTION="Utilities to deal with user accounts"
|
||||
HOMEPAGE="https://github.com/shadow-maint/shadow"
|
||||
SRC_URI="https://github.com/shadow-maint/shadow/releases/download/v${PV}/${P}.tar.xz"
|
||||
SRC_URI="https://github.com/shadow-maint/shadow/releases/download/${PV}/${P}.tar.xz"
|
||||
SRC_URI+=" verify-sig? ( https://github.com/shadow-maint/shadow/releases/download/${PV}/${P}.tar.xz.asc )"
|
||||
|
||||
LICENSE="BSD GPL-2"
|
||||
# Subslot is for libsubid's SONAME.
|
||||
SLOT="0/4"
|
||||
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
|
||||
IUSE="acl audit bcrypt cracklib nls pam selinux skey split-usr su 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 )
|
||||
|
||||
REQUIRED_USE="?? ( cracklib pam )"
|
||||
|
||||
BDEPEND="
|
||||
app-arch/xz-utils
|
||||
sys-devel/gettext
|
||||
"
|
||||
COMMON_DEPEND="
|
||||
virtual/libcrypt:=
|
||||
acl? ( sys-apps/acl:0= )
|
||||
@ -53,6 +50,11 @@ RDEPEND="${COMMON_DEPEND}
|
||||
pam? ( >=sys-auth/pambase-20150213 )
|
||||
su? ( !sys-apps/util-linux[su(-)] )
|
||||
"
|
||||
BDEPEND="
|
||||
app-arch/xz-utils
|
||||
sys-devel/gettext
|
||||
verify-sig? ( sec-keys/openpgp-keys-sergehallyn )
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}/${PN}-4.1.3-dots-in-usernames.patch"
|
||||
@ -61,7 +63,6 @@ PATCHES=(
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
#eautoreconf
|
||||
elibtoolize
|
||||
}
|
||||
|
||||
@ -84,6 +85,7 @@ src_configure() {
|
||||
$(use_with su)
|
||||
$(use_with xattr attr)
|
||||
)
|
||||
|
||||
econf "${myeconfargs[@]}"
|
||||
|
||||
if use nls ; then
|
||||
@ -101,14 +103,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() {
|
||||
@ -119,41 +121,29 @@ src_install() {
|
||||
|
||||
find "${ED}" -name '*.la' -type f -delete || die
|
||||
|
||||
# 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.
|
||||
dotmpfiles "${FILESDIR}"/tmpfiles.d/etc-shadow.conf
|
||||
dotmpfiles "${FILESDIR}"/tmpfiles.d/var-shadow.conf
|
||||
# Package the symlinks for the SDK and containers.
|
||||
systemd-tmpfiles --create --root="${ED}" "${FILESDIR}"/tmpfiles.d/*
|
||||
|
||||
insinto /usr/share/shadow
|
||||
insinto /etc
|
||||
if ! use pam ; then
|
||||
insopts -m0600
|
||||
doins etc/login.access etc/limits
|
||||
fi
|
||||
# Using a securetty with devfs device names added
|
||||
# (compat names kept for non-devfs compatibility)
|
||||
insopts -m0600 ; doins "${FILESDIR}"/securetty
|
||||
# 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
|
||||
|
||||
if use split-usr ; then
|
||||
# move passwd to / to help recover broke systems #64441
|
||||
# We cannot simply remove this or else net-misc/scponly
|
||||
# and other tools will break because of hardcoded passwd
|
||||
# location
|
||||
dodir /bin
|
||||
mv "${ED}"/usr/bin/passwd "${ED}"/bin/ || die
|
||||
dosym ../../bin/passwd /usr/bin/passwd
|
||||
fi
|
||||
|
||||
cd "${S}" || die
|
||||
insinto /etc
|
||||
insopts -m0644
|
||||
newins etc/login.defs login.defs
|
||||
|
||||
@ -178,7 +168,7 @@ src_install() {
|
||||
|
||||
newpamd "${FILESDIR}"/pam.d-include/shadow-r1 groupmems
|
||||
|
||||
# comment out login.defs options that pam hates
|
||||
# Comment out login.defs options that pam hates
|
||||
local opt sed_args=()
|
||||
for opt in \
|
||||
CHFN_AUTH \
|
||||
@ -207,9 +197,9 @@ 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
|
||||
# Remove manpages that pam will install for us
|
||||
# and/or don't apply when using pam
|
||||
find "${ED}"/usr/share/man -type f \
|
||||
'(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
|
||||
@ -242,3 +232,28 @@ pkg_preinst() {
|
||||
rm -f "${EROOT}"/etc/pam.d/system-auth.new \
|
||||
"${EROOT}/etc/login.defs.new"
|
||||
}
|
||||
|
||||
pkg_postinst() {
|
||||
# Missing entries from /etc/passwd can cause odd system blips.
|
||||
# See bug #829872.
|
||||
if ! pwck -r -q -R "${EROOT:-/}" &>/dev/null ; then
|
||||
ewarn "Running 'pwck' returned errors. Please run it manually to fix any errors."
|
||||
fi
|
||||
|
||||
# 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
|
||||
|
||||
[[ ! -f "${EROOT}"/etc/subgid ]] &&
|
||||
touch "${EROOT}"/etc/subgid
|
||||
[[ ! -f "${EROOT}"/etc/subuid ]] &&
|
||||
touch "${EROOT}"/etc/subuid
|
||||
|
||||
einfo "The 'adduser' symlink to 'useradd' has been dropped."
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user