From 50343911ab80fcbaac7ea97e5fc6178b2eaf9d11 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 27 Jul 2012 10:38:03 +0200 Subject: [PATCH] shadow: remove utils provided by util-linux>=2.22. --- srcpkgs/shadow/files/LICENSE | 31 +++++++++++++++++++ srcpkgs/shadow/files/login.pam | 19 ------------ srcpkgs/shadow/files/su.pam | 7 ----- srcpkgs/shadow/template | 54 ++++++++++++++++++++++++++-------- 4 files changed, 72 insertions(+), 39 deletions(-) create mode 100644 srcpkgs/shadow/files/LICENSE delete mode 100644 srcpkgs/shadow/files/login.pam delete mode 100644 srcpkgs/shadow/files/su.pam diff --git a/srcpkgs/shadow/files/LICENSE b/srcpkgs/shadow/files/LICENSE new file mode 100644 index 00000000000..c5ab15a5607 --- /dev/null +++ b/srcpkgs/shadow/files/LICENSE @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1990 - 1994, Julianne Frances Haugh + * Copyright (c) 1996 - 2000, Marek Michałkiewicz + * Copyright (c) 2001 - 2006, Tomasz Kłoczko + * Copyright (c) 2007 - 2009, Nicolas François + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the copyright holders or contributors may not be used to + * endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ diff --git a/srcpkgs/shadow/files/login.pam b/srcpkgs/shadow/files/login.pam deleted file mode 100644 index 536777dfb75..00000000000 --- a/srcpkgs/shadow/files/login.pam +++ /dev/null @@ -1,19 +0,0 @@ -# login pam service with sha512 passwords and cracklib support. -auth requisite pam_nologin.so -auth required pam_securetty.so -auth required pam_unix.so - -account required pam_access.so -account required pam_unix.so - -session required pam_env.so -session required pam_motd.so -session optional pam_mail.so dir=/var/mail standard -session optional pam_lastlog.so -session required pam_unix.so -session required pam_loginuid.so -session required pam_systemd.so kill-session-processes=1 -session required pam_limits.so - -password required pam_cracklib.so try_first_pass retry=3 -password required pam_unix.so sha512 shadow nullok try_first_pass use_authtok diff --git a/srcpkgs/shadow/files/su.pam b/srcpkgs/shadow/files/su.pam deleted file mode 100644 index 2307f44c19b..00000000000 --- a/srcpkgs/shadow/files/su.pam +++ /dev/null @@ -1,7 +0,0 @@ -auth sufficient pam_rootok.so -auth required pam_unix.so -account required pam_unix.so -session optional pam_mail.so dir=/var/mail standard -session optional pam_xauth.so -session required pam_env.so -session required pam_unix.so diff --git a/srcpkgs/shadow/template b/srcpkgs/shadow/template index 0d0bd39c47b..0d5d1c9c3d3 100644 --- a/srcpkgs/shadow/template +++ b/srcpkgs/shadow/template @@ -1,7 +1,7 @@ # Template file for 'shadow' pkgname=shadow version=4.1.5.1 -revision=2 +revision=3 build_style=gnu-configure configure_args="--bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib --enable-shared --disable-static @@ -16,12 +16,22 @@ checksum=aa32333748d68b58ed3a83625f0165e0f6b9dc4639e6377c9300c6bf4fe978fb long_desc=" Shadow password file utilities for GNU/Linux." -conf_files="/etc/pam.d/usermod /etc/pam.d/userdel /etc/pam.d/useradd -/etc/pam.d/su /etc/pam.d/passwd /etc/pam.d/newusers /etc/pam.d/login -/etc/pam.d/groupmod /etc/pam.d/groupmems /etc/pam.d/groupdel -/etc/pam.d/groupadd /etc/pam.d/chsh /etc/pam.d/chpasswd -/etc/pam.d/chgpasswd /etc/pam.d/chfn /etc/pam.d/chage /etc/defaults/useradd -/etc/pam.d/other /etc/login.defs" +conf_files=" +/etc/pam.d/usermod +/etc/pam.d/userdel +/etc/pam.d/useradd +/etc/pam.d/passwd +/etc/pam.d/newusers +/etc/pam.d/groupmod +/etc/pam.d/groupmems +/etc/pam.d/groupdel +/etc/pam.d/groupadd +/etc/pam.d/chpasswd +/etc/pam.d/chgpasswd +/etc/pam.d/chage +/etc/defaults/useradd +/etc/pam.d/other +/etc/login.defs" # Build PIE binaries by default. CFLAGS="-fPIE" @@ -38,11 +48,11 @@ pre_build() { post_install() { # Install our pam files not the ones supplied with shadow. rm -f ${DESTDIR}/etc/pam.d/* - for f in chage login passwd su other; do + for f in chage passwd other; do install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f} done for f in chpasswd chgpasswd groupadd groupdel groupmems \ - groupmod newusers useradd userdel usermod chsh chfn; do + groupmod newusers useradd userdel usermod; do install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f} done install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc @@ -54,10 +64,28 @@ post_install() { install -D -m744 ${FILESDIR}/shadow.cron-daily \ ${DESTDIR}/etc/cron.daily/shadow - # Remove unused files due to PAM. - for f in login.access limits; do - [ -f ${DESTDIR}/etc/${f} ] && rm -f ${DESTDIR}/etc/${f} - done # Remove groups.1 manpages that comes with coreutils. rm -f ${DESTDIR}/usr/share/man/man1/groups.1 + + # Remove utilities provided by util-linux + rm \ + $DESTDIR/usr/bin/{chsh,chfn,sg} \ + $DESTDIR/usr/bin/{login,su} \ + $DESTDIR/usr/sbin/{vipw,vigr} + + # but we keep newgrp, as sg is really an alias to it + mv $DESTDIR/usr/bin/{newgrp,sg} + + # ...and their many man pages + find $DESTDIR/usr/share/man \ + '(' -name 'chsh.1' -o \ + -name 'chfn.1' -o \ + -name 'su.1' -o \ + -name 'login.1' -o \ + -name 'vipw.8' -o \ + -name 'vigr.8' -o \ + -name 'newgrp.1' ')' \ + -delete + + vinstall $FILESDIR/LICENSE 644 usr/share/licenses/shadow }