Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/shadow/
Date: Mon, 03 Jan 2022 03:33:06
Message-Id: 1641180771.d0655b622b482b912babb22529dabcf92aaf618e.sam@gentoo
1 commit: d0655b622b482b912babb22529dabcf92aaf618e
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 3 03:30:53 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 3 03:32:51 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0655b62
7
8 sys-apps/shadow: add 4.11.1
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-apps/shadow/Manifest | 1 +
13 sys-apps/shadow/shadow-4.11.1.ebuild | 256 +++++++++++++++++++++++++++++++++++
14 2 files changed, 257 insertions(+)
15
16 diff --git a/sys-apps/shadow/Manifest b/sys-apps/shadow/Manifest
17 index 35b49660564f..1256ca7babdb 100644
18 --- a/sys-apps/shadow/Manifest
19 +++ b/sys-apps/shadow/Manifest
20 @@ -1,3 +1,4 @@
21 DIST shadow-4.10.tar.xz 1662364 BLAKE2B 80b5f0f6b8fbb3e2ca134e14e93a3f67e5baa34d793ace5b90690676634f4cc72dfb4b3d50dbd7626c1a144898c1c943f8acbc8121903f17519c981986c284ae SHA512 39ffc1863d1f84aa39a2983c08e5adb93642b09e3e5e65c1c4e8a342207a79201b199e518e3701726014c7cb736977ef275d2dc1c659b5776183ae73978357da
22 +DIST shadow-4.11.1.tar.xz 1656584 BLAKE2B d459a1e0ffb342b6b455caf65e6af60b32eee72d4a9b1ab126485fb4632503a42061d3f0b960554c8155af6dc0564c585335b27aecca6538b394a0d58d927588 SHA512 12fbe4d6ac929ad3c21525ed0f1026b5b678ccec9762f2ec7e611d9c180934def506325f2835fb750dd30af035b592f827ff151cd6e4c805aaaf8e01425c279f
23 DIST shadow-4.8.1.tar.xz 1611196 BLAKE2B 952707cdd55dc6c00dcbc60dbc3bf84ac618dbe916b36d993802b3ce42594de332a9bc22933a28881af3d317a340eab017ada55511b4e4fbc3ca6b422c4bc254 SHA512 780a983483d847ed3c91c82064a0fa902b6f4185225978241bc3bc03fcc3aa143975b46aee43151c6ba43efcfdb1819516b76ba7ad3d1d3c34fcc38ea42e917b
24 DIST shadow-4.9.tar.xz 1627008 BLAKE2B 7a9a6a489115c7a20520cfec61f008fc0f70f7f50aaf539e94dfdcb20035d2de88ab3198e76812a4e3eb944b92c76c0ca2e85e35f4342537711c2c033248a72b SHA512 254cda49bb14505a7604821e7fa898bf4bf317d648e9ddc881ab80a6860d52053dfffacad6feab87c7d16608c35ed6b6cee99e7757eac930da3a7b31cdcd4b95
25
26 diff --git a/sys-apps/shadow/shadow-4.11.1.ebuild b/sys-apps/shadow/shadow-4.11.1.ebuild
27 new file mode 100644
28 index 000000000000..f9a60e2b722d
29 --- /dev/null
30 +++ b/sys-apps/shadow/shadow-4.11.1.ebuild
31 @@ -0,0 +1,256 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit libtool pam
38 +
39 +DESCRIPTION="Utilities to deal with user accounts"
40 +HOMEPAGE="https://github.com/shadow-maint/shadow"
41 +SRC_URI="https://github.com/shadow-maint/shadow/releases/download/v${PV}/${P}.tar.xz"
42 +
43 +LICENSE="BSD GPL-2"
44 +# Subslot is for libsubid's SONAME.
45 +SLOT="0/4"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
47 +IUSE="acl audit bcrypt cracklib nls pam selinux skey split-usr su xattr"
48 +# Taken from the man/Makefile.am file.
49 +LANGS=( cs da de es fi fr hu id it ja ko pl pt_BR ru sv tr zh_CN zh_TW )
50 +
51 +REQUIRED_USE="?? ( cracklib pam )"
52 +
53 +BDEPEND="
54 + app-arch/xz-utils
55 + sys-devel/gettext
56 +"
57 +COMMON_DEPEND="
58 + virtual/libcrypt:=
59 + acl? ( sys-apps/acl:0= )
60 + audit? ( >=sys-process/audit-2.6:0= )
61 + cracklib? ( >=sys-libs/cracklib-2.7-r3:0= )
62 + nls? ( virtual/libintl )
63 + pam? ( sys-libs/pam:0= )
64 + skey? ( sys-auth/skey:0= )
65 + selinux? (
66 + >=sys-libs/libselinux-1.28:0=
67 + sys-libs/libsemanage:0=
68 + )
69 + xattr? ( sys-apps/attr:0= )
70 +"
71 +DEPEND="${COMMON_DEPEND}
72 + >=sys-kernel/linux-headers-4.14
73 +"
74 +RDEPEND="${COMMON_DEPEND}
75 + !<sys-apps/man-pages-5.11-r1
76 + !=sys-apps/man-pages-5.12-r0
77 + !=sys-apps/man-pages-5.12-r1
78 + nls? (
79 + !<app-i18n/man-pages-it-5.06-r1
80 + !<app-i18n/man-pages-ja-20180315-r1
81 + !<app-i18n/man-pages-ru-5.03.2390.2390.20191017-r1
82 + )
83 + pam? ( >=sys-auth/pambase-20150213 )
84 + su? ( !sys-apps/util-linux[su(-)] )
85 +"
86 +
87 +PATCHES=(
88 + "${FILESDIR}/${PN}-4.1.3-dots-in-usernames.patch"
89 +)
90 +
91 +src_prepare() {
92 + default
93 +
94 + #eautoreconf
95 + elibtoolize
96 +}
97 +
98 +src_configure() {
99 + local myeconfargs=(
100 + --disable-account-tools-setuid
101 + --disable-static
102 + --with-btrfs
103 + --without-group-name-max-length
104 + --without-tcb
105 + $(use_enable nls)
106 + $(use_with acl)
107 + $(use_with audit)
108 + $(use_with bcrypt)
109 + $(use_with cracklib libcrack)
110 + $(use_with elibc_glibc nscd)
111 + $(use_with pam libpam)
112 + $(use_with selinux)
113 + $(use_with skey)
114 + $(use_with su)
115 + $(use_with xattr attr)
116 + )
117 + econf "${myeconfargs[@]}"
118 +
119 + if use nls ; then
120 + local l langs="po" # These are the pot files.
121 + for l in ${LANGS[*]} ; do
122 + has ${l} ${LINGUAS-${l}} && langs+=" ${l}"
123 + done
124 + sed -i "/^SUBDIRS = /s:=.*:= ${langs}:" man/Makefile || die
125 + fi
126 +}
127 +
128 +set_login_opt() {
129 + local comment="" opt=${1} val=${2}
130 + if [[ -z ${val} ]]; then
131 + comment="#"
132 + sed -i \
133 + -e "/^${opt}\>/s:^:#:" \
134 + "${ED}"/etc/login.defs || die
135 + else
136 + sed -i -r \
137 + -e "/^#?${opt}\>/s:.*:${opt} ${val}:" \
138 + "${ED}"/etc/login.defs
139 + fi
140 + local res=$(grep "^${comment}${opt}\>" "${ED}"/etc/login.defs)
141 + einfo "${res:-Unable to find ${opt} in /etc/login.defs}"
142 +}
143 +
144 +src_install() {
145 + emake DESTDIR="${D}" suidperms=4711 install
146 +
147 + # 4.9 regression: https://github.com/shadow-maint/shadow/issues/389
148 + emake DESTDIR="${D}" -C man install
149 +
150 + find "${ED}" -name '*.la' -type f -delete || die
151 +
152 + insinto /etc
153 + if ! use pam ; then
154 + insopts -m0600
155 + doins etc/login.access etc/limits
156 + fi
157 +
158 + # needed for 'useradd -D'
159 + insinto /etc/default
160 + insopts -m0600
161 + doins "${FILESDIR}"/default/useradd
162 +
163 + if use split-usr ; then
164 + # move passwd to / to help recover broke systems #64441
165 + # We cannot simply remove this or else net-misc/scponly
166 + # and other tools will break because of hardcoded passwd
167 + # location
168 + dodir /bin
169 + mv "${ED}"/usr/bin/passwd "${ED}"/bin/ || die
170 + dosym ../../bin/passwd /usr/bin/passwd
171 + fi
172 +
173 + cd "${S}" || die
174 + insinto /etc
175 + insopts -m0644
176 + newins etc/login.defs login.defs
177 +
178 + set_login_opt CREATE_HOME yes
179 + if ! use pam ; then
180 + set_login_opt MAIL_CHECK_ENAB no
181 + set_login_opt SU_WHEEL_ONLY yes
182 + set_login_opt CRACKLIB_DICTPATH /usr/lib/cracklib_dict
183 + set_login_opt LOGIN_RETRIES 3
184 + set_login_opt ENCRYPT_METHOD SHA512
185 + set_login_opt CONSOLE
186 + else
187 + dopamd "${FILESDIR}"/pam.d-include/shadow
188 +
189 + for x in chsh shfn ; do
190 + newpamd "${FILESDIR}"/pam.d-include/passwd ${x}
191 + done
192 +
193 + for x in chpasswd newusers ; do
194 + newpamd "${FILESDIR}"/pam.d-include/chpasswd ${x}
195 + done
196 +
197 + newpamd "${FILESDIR}"/pam.d-include/shadow-r1 groupmems
198 +
199 + # comment out login.defs options that pam hates
200 + local opt sed_args=()
201 + for opt in \
202 + CHFN_AUTH \
203 + CONSOLE \
204 + CRACKLIB_DICTPATH \
205 + ENV_HZ \
206 + ENVIRON_FILE \
207 + FAILLOG_ENAB \
208 + FTMP_FILE \
209 + LASTLOG_ENAB \
210 + MAIL_CHECK_ENAB \
211 + MOTD_FILE \
212 + NOLOGINS_FILE \
213 + OBSCURE_CHECKS_ENAB \
214 + PASS_ALWAYS_WARN \
215 + PASS_CHANGE_TRIES \
216 + PASS_MIN_LEN \
217 + PORTTIME_CHECKS_ENAB \
218 + QUOTAS_ENAB \
219 + SU_WHEEL_ONLY
220 + do
221 + set_login_opt ${opt}
222 + sed_args+=( -e "/^#${opt}\>/b pamnote" )
223 + done
224 + sed -i "${sed_args[@]}" \
225 + -e 'b exit' \
226 + -e ': pamnote; i# NOTE: This setting should be configured via /etc/pam.d/ and not in this file.' \
227 + -e ': exit' \
228 + "${ED}"/etc/login.defs || die
229 +
230 + # remove manpages that pam will install for us
231 + # and/or don't apply when using pam
232 + find "${ED}"/usr/share/man -type f \
233 + '(' -name 'limits.5*' -o -name 'suauth.5*' ')' \
234 + -delete
235 +
236 + # Remove pam.d files provided by pambase.
237 + rm "${ED}"/etc/pam.d/{login,passwd} || die
238 + if use su ; then
239 + rm "${ED}"/etc/pam.d/su || die
240 + fi
241 + fi
242 +
243 + # Remove manpages that are handled by other packages
244 + find "${ED}"/usr/share/man -type f \
245 + '(' -name id.1 -o -name getspnam.3 ')' \
246 + -delete || die
247 +
248 + if ! use su ; then
249 + find "${ED}"/usr/share/man -type f -name su.1 -delete || die
250 + fi
251 +
252 + cd "${S}" || die
253 + dodoc ChangeLog NEWS TODO
254 + newdoc README README.download
255 + cd doc || die
256 + dodoc HOWTO README* WISHLIST *.txt
257 +}
258 +
259 +pkg_preinst() {
260 + rm -f "${EROOT}"/etc/pam.d/system-auth.new \
261 + "${EROOT}/etc/login.defs.new"
262 +}
263 +
264 +pkg_postinst() {
265 + # Missing entries from /etc/passwd can cause odd system blips.
266 + # See bug #829872.
267 + if ! pwck -r -q -R "${EROOT:-/}" &>/dev/null ; then
268 + ewarn "Running 'pwck' returned errors. Please run it manually to fix any errors."
269 + fi
270 +
271 + # Enable shadow groups.
272 + if [ ! -f "${EROOT}"/etc/gshadow ] ; then
273 + if grpck -r -R "${EROOT:-/}" 2>/dev/null ; then
274 + grpconv -R "${EROOT:-/}"
275 + else
276 + ewarn "Running 'grpck' returned errors. Please run it by hand, and then"
277 + ewarn "run 'grpconv' afterwards!"
278 + fi
279 + fi
280 +
281 + [[ ! -f "${EROOT}"/etc/subgid ]] &&
282 + touch "${EROOT}"/etc/subgid
283 + [[ ! -f "${EROOT}"/etc/subuid ]] &&
284 + touch "${EROOT}"/etc/subuid
285 +
286 + einfo "The 'adduser' symlink to 'useradd' has been dropped."
287 +}