Gentoo Archives: gentoo-commits

From: Lars Wendler <polynomial-c@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/shadow/
Date: Sun, 01 Dec 2019 19:18:10
Message-Id: 1575227881.f48eb45d13d06263c1c8d3716df58868307958a6.polynomial-c@gentoo
1 commit: f48eb45d13d06263c1c8d3716df58868307958a6
2 Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 1 19:10:04 2019 +0000
4 Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 1 19:18:01 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f48eb45d
7
8 sys-apps/shadow: Bump to version 4.8
9
10 Package-Manager: Portage-2.3.80, Repoman-2.3.19
11 Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
12
13 sys-apps/shadow/Manifest | 1 +
14 sys-apps/shadow/metadata.xml | 1 +
15 sys-apps/shadow/shadow-4.8.ebuild | 228 ++++++++++++++++++++++++++++++++++++++
16 3 files changed, 230 insertions(+)
17
18 diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest
19 index 3aae04af88c..2833ecca8e6 100644
20 --- a/sys-apps/shadow/Manifest
21 +++ b/sys-apps/shadow/Manifest
22 @@ -1,2 +1,3 @@
23 DIST shadow-4.6.tar.gz 3804282 BLAKE2B 268c90e7daba138827aec6039f428f52cdcf7929743fa1f49f801cc669de7456ec5a69531194cdb29f051ce7d0b2f1e966fdf2513a9fc8f7fbdeb29d786a509f SHA512 36358333e7f03ef558772f3361bc5851a7d7fd3d85c993a6b732e37304b8068b2893d55607b9bfe8b8eed616a687264f947ff66cefc74ea1a48ba9396d464714
24 DIST shadow-4.7.tar.gz 3833335 BLAKE2B 8e030d3dcc5eb76332ff76aad8e9141edb4ae660f56dd3b420968c538d3022a72ab620710b9274b9afb44f497399f5c4ceef339b7d2c52106b9b8368ff127654 SHA512 9b134dc90d8fb39bc72db69ddb78cef6263921c8a2f00abc00ac796bf468ac18393399920eec14bd2a78b814a06fc18eb6f5685ede13fe222fc66b2e411cbb01
25 +DIST shadow-4.8.tar.xz 1609060 BLAKE2B 9d0b515e40f45c0baf420ef7ffaf5b6dd7989b26c93fc6dd610876263ac22e61fbc2821649d347c28055ae84f64cd5ab5c2435450c55339c80b4ae5062ccc44f SHA512 1c607aec541400fc179d6cbbac7511289c618ab2ce6ee9d7c18a8bfda00421c62d4b9e58aff52b5f82d485468e7db955c186ea0faad9a08003ffc01bdf2ccece
26
27 diff --git a/sys-apps/shadow/metadata.xml b/sys-apps/shadow/metadata.xml
28 index a69630c7b1e..908eabb59f3 100644
29 --- a/sys-apps/shadow/metadata.xml
30 +++ b/sys-apps/shadow/metadata.xml
31 @@ -6,6 +6,7 @@
32 <name>Gentoo Base System</name>
33 </maintainer>
34 <use>
35 + <flag name="bcrypt">build the bcrypt password encryption algorithm</flag>
36 <flag name="su">build the su program</flag>
37 </use>
38 <!-- only for USE=pam -->
39
40 diff --git a/sys-apps/shadow/shadow-4.8.ebuild b/sys-apps/shadow/shadow-4.8.ebuild
41 new file mode 100644
42 index 00000000000..11bb45bfd04
43 --- /dev/null
44 +++ b/sys-apps/shadow/shadow-4.8.ebuild
45 @@ -0,0 +1,228 @@
46 +# Copyright 1999-2019 Gentoo Authors
47 +# Distributed under the terms of the GNU General Public License v2
48 +
49 +EAPI=7
50 +
51 +inherit libtool pam
52 +
53 +DESCRIPTION="Utilities to deal with user accounts"
54 +HOMEPAGE="https://github.com/shadow-maint/shadow"
55 +SRC_URI="https://github.com/shadow-maint/shadow/releases/download/${PV}/${P}.tar.xz"
56 +
57 +LICENSE="BSD GPL-2"
58 +SLOT="0"
59 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86"
60 +IUSE="acl audit bcrypt +cracklib nls pam selinux skey split-usr +su xattr"
61 +# Taken from the man/Makefile.am file.
62 +LANGS=( cs da de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW )
63 +
64 +DEPEND="
65 + acl? ( sys-apps/acl:0= )
66 + audit? ( >=sys-process/audit-2.6:0= )
67 + cracklib? ( >=sys-libs/cracklib-2.7-r3:0= )
68 + nls? ( virtual/libintl )
69 + pam? ( sys-libs/pam:0= )
70 + skey? ( sys-auth/skey:0= )
71 + selinux? (
72 + >=sys-libs/libselinux-1.28:0=
73 + sys-libs/libsemanage:0=
74 + )
75 + su? ( !sys-apps/util-linux[su] )
76 + xattr? ( sys-apps/attr:0= )
77 +"
78 +BDEPEND="
79 + app-arch/xz-utils
80 + sys-devel/gettext
81 +"
82 +RDEPEND="
83 + ${DEPEND}
84 + pam? ( >=sys-auth/pambase-20150213 )
85 +"
86 +
87 +PATCHES=(
88 + "${FILESDIR}/${PN}-4.1.3-dots-in-usernames.patch"
89 +)
90 +
91 +src_prepare() {
92 + default
93 + #eautoreconf
94 + elibtoolize
95 +}
96 +
97 +src_configure() {
98 + local myeconfargs=(
99 + --with-btrfs
100 + --without-group-name-max-length
101 + --without-tcb
102 + --enable-shared=no
103 + --enable-static=yes
104 + $(use_enable nls)
105 + $(use_with acl)
106 + $(use_with audit)
107 + $(use_with bcrypt)
108 + $(use_with cracklib libcrack)
109 + $(use_with elibc_glibc nscd)
110 + $(use_with pam libpam)
111 + $(use_with selinux)
112 + $(use_with skey)
113 + $(use_with su)
114 + $(use_with xattr attr)
115 + )
116 + econf "${myeconfargs[@]}"
117 +
118 + has_version 'sys-libs/uclibc[-rpc]' && sed -i '/RLOGIN/d' config.h #425052
119 +
120 + if use nls ; then
121 + local l langs="po" # These are the pot files.
122 + for l in ${LANGS[*]} ; do
123 + has ${l} ${LINGUAS-${l}} && langs+=" ${l}"
124 + done
125 + sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die
126 + fi
127 +}
128 +
129 +set_login_opt() {
130 + local comment="" opt=$1 val=$2
131 + if [[ -z ${val} ]]; then
132 + comment="#"
133 + sed -i \
134 + -e "/^${opt}\>/s:^:#:" \
135 + "${ED}"/etc/login.defs || die
136 + else
137 + sed -i -r \
138 + -e "/^#?${opt}\>/s:.*:${opt} ${val}:" \
139 + "${ED}"/etc/login.defs
140 + fi
141 + local res=$(grep "^${comment}${opt}\>" "${ED}"/etc/login.defs)
142 + einfo "${res:-Unable to find ${opt} in /etc/login.defs}"
143 +}
144 +
145 +src_install() {
146 + emake DESTDIR="${D}" suidperms=4711 install
147 +
148 + # Remove libshadow and libmisc; see bug 37725 and the following
149 + # comment from shadow's README.linux:
150 + # Currently, libshadow.a is for internal use only, so if you see
151 + # -lshadow in a Makefile of some other package, it is safe to
152 + # remove it.
153 + rm -f "${ED}"/{,usr/}$(get_libdir)/lib{misc,shadow}.{a,la}
154 +
155 + insinto /etc
156 + if ! use pam ; then
157 + insopts -m0600
158 + doins etc/login.access etc/limits
159 + fi
160 +
161 + # needed for 'useradd -D'
162 + insinto /etc/default
163 + insopts -m0600
164 + doins "${FILESDIR}"/default/useradd
165 +
166 + if use split-usr ; then
167 + dosym ../../bin/passwd /usr/bin/passwd
168 + fi
169 +
170 + cd "${S}" || die
171 + insinto /etc
172 + insopts -m0644
173 + newins etc/login.defs login.defs
174 +
175 + set_login_opt CREATE_HOME yes
176 + if ! use pam ; then
177 + set_login_opt MAIL_CHECK_ENAB no
178 + set_login_opt SU_WHEEL_ONLY yes
179 + set_login_opt CRACKLIB_DICTPATH /usr/$(get_libdir)/cracklib_dict
180 + set_login_opt LOGIN_RETRIES 3
181 + set_login_opt ENCRYPT_METHOD SHA512
182 + set_login_opt CONSOLE
183 + else
184 + dopamd "${FILESDIR}"/pam.d-include/shadow
185 +
186 + for x in chpasswd chgpasswd newusers; do
187 + newpamd "${FILESDIR}"/pam.d-include/passwd ${x}
188 + done
189 +
190 + for x in chage chsh chfn \
191 + user{add,del,mod} group{add,del,mod} ; do
192 + newpamd "${FILESDIR}"/pam.d-include/shadow ${x}
193 + done
194 +
195 + # comment out login.defs options that pam hates
196 + local opt sed_args=()
197 + for opt in \
198 + CHFN_AUTH \
199 + CONSOLE \
200 + CRACKLIB_DICTPATH \
201 + ENV_HZ \
202 + ENVIRON_FILE \
203 + FAILLOG_ENAB \
204 + FTMP_FILE \
205 + LASTLOG_ENAB \
206 + MAIL_CHECK_ENAB \
207 + MOTD_FILE \
208 + NOLOGINS_FILE \
209 + OBSCURE_CHECKS_ENAB \
210 + PASS_ALWAYS_WARN \
211 + PASS_CHANGE_TRIES \
212 + PASS_MIN_LEN \
213 + PORTTIME_CHECKS_ENAB \
214 + QUOTAS_ENAB \
215 + SU_WHEEL_ONLY
216 + do
217 + set_login_opt ${opt}
218 + sed_args+=( -e "/^#${opt}\>/b pamnote" )
219 + done
220 + sed -i "${sed_args[@]}" \
221 + -e 'b exit' \
222 + -e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \
223 + -e ': exit' \
224 + "${ED}"/etc/login.defs || die
225 +
226 + # remove manpages that pam will install for us
227 + # and/or don't apply when using pam
228 + find "${ED}"/usr/share/man -type f \
229 + '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
230 + -delete
231 +
232 + # Remove pam.d files provided by pambase.
233 + rm "${ED}"/etc/pam.d/{login,passwd} || die
234 + if use su ; then
235 + rm "${ED}"/etc/pam.d/su || die
236 + fi
237 + fi
238 +
239 + # Remove manpages that are handled by other packages
240 + find "${ED}"/usr/share/man \
241 + '(' -name id.1 -o -name passwd.5 -o -name getspnam.3 ')' \
242 + -delete
243 +
244 + cd "${S}" || die
245 + dodoc ChangeLog NEWS TODO
246 + newdoc README README.download
247 + cd doc || die
248 + dodoc HOWTO README* WISHLIST *.txt
249 +}
250 +
251 +pkg_preinst() {
252 + rm -f "${EROOT}"/etc/pam.d/system-auth.new \
253 + "${EROOT}/etc/login.defs.new"
254 +}
255 +
256 +pkg_postinst() {
257 + # Enable shadow groups.
258 + if [ ! -f "${EROOT}"/etc/gshadow ] ; then
259 + if grpck -r -R "${EROOT}" 2>/dev/null ; then
260 + grpconv -R "${EROOT}"
261 + else
262 + ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
263 + ewarn "run 'grpconv' afterwards!"
264 + fi
265 + fi
266 +
267 + [[ ! -f "${EROOT}"/etc/subgid ]] &&
268 + touch "${EROOT}"/etc/subgid
269 + [[ ! -f "${EROOT}"/etc/subuid ]] &&
270 + touch "${EROOT}"/etc/subuid
271 +
272 + einfo "The 'adduser' symlink to 'useradd' has been dropped."
273 +}