util-linux: set correct perms to some utils and don't error out if chgrp fails.

This commit is contained in:
Juan RP 2012-12-19 14:49:46 +01:00
parent 4214e1fd61
commit 68f7fc8383
2 changed files with 14 additions and 5 deletions

View file

@ -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

View file

@ -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
}