mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-20 22:11:39 +02:00
sys-apps/shadow: Import Gentoo's latest stable version
This commit is contained in:
parent
8f764a0b7f
commit
5f519ff3e3
@ -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
|
||||||
|
@ -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,9 +1,9 @@
|
|||||||
# Copyright 1999-2017 Gentoo Foundation
|
# Copyright 1999-2018 Gentoo Foundation
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
# 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"
|
DESCRIPTION="Utilities to deal with user accounts"
|
||||||
HOMEPAGE="https://github.com/shadow-maint/shadow http://pkg-shadow.alioth.debian.org/"
|
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"
|
LICENSE="BSD GPL-2"
|
||||||
SLOT="0"
|
SLOT="0"
|
||||||
KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
|
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
|
||||||
IUSE="acl audit cracklib nls pam selinux skey xattr"
|
IUSE="acl audit +cracklib nls pam selinux skey xattr"
|
||||||
# Taken from the man/Makefile.am file.
|
# 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 )
|
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= )
|
RDEPEND="acl? ( sys-apps/acl:0= )
|
||||||
audit? ( >=sys-process/audit-2.6:0= )
|
audit? ( >=sys-process/audit-2.6:0= )
|
||||||
@ -35,37 +34,39 @@ RDEPEND="${RDEPEND}
|
|||||||
pam? ( >=sys-auth/pambase-20150213 )"
|
pam? ( >=sys-auth/pambase-20150213 )"
|
||||||
|
|
||||||
PATCHES=(
|
PATCHES=(
|
||||||
"${FILESDIR}"/${PN}-4.1.3-dots-in-usernames.patch
|
"${FILESDIR}/${PN}-4.1.3-dots-in-usernames.patch"
|
||||||
)
|
)
|
||||||
|
|
||||||
src_prepare() {
|
src_prepare() {
|
||||||
epatch "${PATCHES[@]}"
|
default
|
||||||
epatch_user
|
|
||||||
#eautoreconf
|
#eautoreconf
|
||||||
elibtoolize
|
elibtoolize
|
||||||
}
|
}
|
||||||
|
|
||||||
src_configure() {
|
src_configure() {
|
||||||
econf \
|
local myeconfargs=(
|
||||||
--without-group-name-max-length \
|
--without-group-name-max-length
|
||||||
--without-tcb \
|
--without-tcb
|
||||||
--enable-shared=no \
|
--enable-shared=no
|
||||||
--enable-static=yes \
|
--enable-static=yes
|
||||||
$(use_with acl) \
|
$(use_with acl)
|
||||||
$(use_with audit) \
|
$(use_with audit)
|
||||||
$(use_with cracklib libcrack) \
|
$(use_with cracklib libcrack)
|
||||||
$(use_with pam libpam) \
|
$(use_with pam libpam)
|
||||||
$(use_with skey) \
|
$(use_with skey)
|
||||||
$(use_with selinux) \
|
$(use_with selinux)
|
||||||
$(use_enable nls) \
|
$(use_enable nls)
|
||||||
$(use_with elibc_glibc nscd) \
|
$(use_with elibc_glibc nscd)
|
||||||
$(use_with xattr attr)
|
$(use_with xattr attr)
|
||||||
|
)
|
||||||
|
econf "${myeconfargs[@]}"
|
||||||
|
|
||||||
has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
|
has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
|
||||||
|
|
||||||
if use nls ; then
|
if use nls ; then
|
||||||
local l langs="po" # These are the pot files.
|
local l langs="po" # These are the pot files.
|
||||||
for l in ${LANGS[*]} ; do
|
for l in ${LANGS[*]} ; do
|
||||||
use linguas_${l} && langs+=" ${l}"
|
has ${l} ${LINGUAS-${l}} && langs+=" ${l}"
|
||||||
done
|
done
|
||||||
sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die
|
sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die
|
||||||
fi
|
fi
|
||||||
@ -77,14 +78,14 @@ set_login_opt() {
|
|||||||
comment="#"
|
comment="#"
|
||||||
sed -i \
|
sed -i \
|
||||||
-e "/^${opt}\>/s:^:#:" \
|
-e "/^${opt}\>/s:^:#:" \
|
||||||
"${ED}"/usr/share/shadow/login.defs || die
|
"${ED%/}"/etc/login.defs || die
|
||||||
else
|
else
|
||||||
sed -i -r \
|
sed -i -r \
|
||||||
-e "/^#?${opt}\>/s:.*:${opt} ${val}:" \
|
-e "/^#?${opt}\>/s:.*:${opt} ${val}:" \
|
||||||
"${ED}"/usr/share/shadow/login.defs
|
"${ED%/}"/etc/login.defs
|
||||||
fi
|
fi
|
||||||
local res=$(grep "^${comment}${opt}\>" "${ED}"/usr/share/shadow/login.defs)
|
local res=$(grep "^${comment}${opt}\>" "${ED%/}"/etc/login.defs)
|
||||||
einfo "${res:-Unable to find ${opt} in /usr/share/shadow/login.defs}"
|
einfo "${res:-Unable to find ${opt} in /etc/login.defs}"
|
||||||
}
|
}
|
||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
@ -95,41 +96,25 @@ src_install() {
|
|||||||
# Currently, libshadow.a is for internal use only, so if you see
|
# Currently, libshadow.a is for internal use only, so if you see
|
||||||
# -lshadow in a Makefile of some other package, it is safe to
|
# -lshadow in a Makefile of some other package, it is safe to
|
||||||
# remove it.
|
# 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.
|
insinto /etc
|
||||||
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
|
|
||||||
if ! use pam ; then
|
if ! use pam ; then
|
||||||
insopts -m0600
|
insopts -m0600
|
||||||
doins etc/login.access etc/limits
|
doins etc/login.access etc/limits
|
||||||
fi
|
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'
|
# needed for 'useradd -D'
|
||||||
|
insinto /etc/default
|
||||||
insopts -m0600
|
insopts -m0600
|
||||||
doins "${FILESDIR}"/default/useradd
|
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
|
insopts -m0644
|
||||||
newins etc/login.defs login.defs
|
newins etc/login.defs login.defs
|
||||||
|
|
||||||
@ -182,27 +167,27 @@ src_install() {
|
|||||||
-e 'b exit' \
|
-e 'b exit' \
|
||||||
-e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \
|
-e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \
|
||||||
-e ': exit' \
|
-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
|
# 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*' ')' \
|
'(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
|
||||||
-delete
|
-delete
|
||||||
|
|
||||||
# Remove pam.d files provided by pambase.
|
# 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
|
fi
|
||||||
|
|
||||||
# Remove manpages that are handled by other packages
|
# 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 ')' \
|
'(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
|
||||||
-delete
|
-delete
|
||||||
|
|
||||||
cd "${S}"
|
cd "${S}" || die
|
||||||
dodoc ChangeLog NEWS TODO
|
dodoc ChangeLog NEWS TODO
|
||||||
newdoc README README.download
|
newdoc README README.download
|
||||||
cd doc
|
cd doc || die
|
||||||
dodoc HOWTO README* WISHLIST *.txt
|
dodoc HOWTO README* WISHLIST *.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,3 +195,17 @@ pkg_preinst() {
|
|||||||
rm -f "${EROOT}"/etc/pam.d/system-auth.new \
|
rm -f "${EROOT}"/etc/pam.d/system-auth.new \
|
||||||
"${EROOT}/etc/login.defs.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."
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user