From 68f7fc83832dad226bc4364d9487ce08eb157b33 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 19 Dec 2012 14:49:46 +0100 Subject: [PATCH] util-linux: set correct perms to some utils and don't error out if chgrp fails. --- srcpkgs/util-linux/INSTALL | 9 ++++++--- srcpkgs/util-linux/template | 10 ++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/srcpkgs/util-linux/INSTALL b/srcpkgs/util-linux/INSTALL index fe13feadd96..7ff6c580a2d 100644 --- a/srcpkgs/util-linux/INSTALL +++ b/srcpkgs/util-linux/INSTALL @@ -3,8 +3,11 @@ # case "${ACTION}" in post) - # Change group in some files. - bin/chgrp tty usr/bin/write usr/bin/wall - [ $? -eq 0 ] && echo "Setting 'tty' group to wall(1) and write(1)." + set +e + # Do not fail if chgrp fails (probably due to permissions). + for f in wall write; do + chgrp tty usr/bin/${f} || \ + echo "WARNING: failed to change ${f}(1) group to tty." + done ;; esac diff --git a/srcpkgs/util-linux/template b/srcpkgs/util-linux/template index cc01160cd79..afc13663673 100644 --- a/srcpkgs/util-linux/template +++ b/srcpkgs/util-linux/template @@ -1,7 +1,7 @@ # Template file for 'util-linux' pkgname=util-linux version=2.22.2 -revision=1 +revision=2 depends="coreutils shadow>=4.1.5.1_3" makedepends="pkg-config zlib-devel ncurses-devel pam-devel" replaces="util-linux-ng>=0 e2fsprogs<=1.41.14_1 eject>=0 shadow<4.1.5.1_3" @@ -27,6 +27,7 @@ conf_files=" /etc/pam.d/chfn /etc/pam.d/chsh /etc/pam.d/su +/etc/pam.d/su-l /etc/pam.d/login" do_configure() { @@ -49,12 +50,17 @@ do_build() { do_install() { make DESTDIR=${DESTDIR} install + # Correct perms for newgrp, chfn, chsh, wall and write. + chmod u+s $DESTDIR/usr/bin/{newgrp,chsh,chfn} + chmod g+s $DESTDIR/usr/bin/{wall,write} + # pam login utils. vinstall $FILESDIR/login.pam 644 etc/pam.d login vinstall $FILESDIR/su.pam 644 etc/pam.d su + vinstall $FILESDIR/su.pam 644 etc/pam.d su-l vinstall $FILESDIR/common.pam 644 etc/pam.d chfn vinstall $FILESDIR/common.pam 644 etc/pam.d chsh # Provide sg(1) symlink. - cd ${DESTDIR}/usr/bin && ln -sf newgrp sg + ln -sfr ${DESTDIR}/usr/bin/newgrp ${DESTDIR}/usr/bin/sg }