#! /bin/sh
# vi:ts=4
# postinst script for misc_tools

set -e

V=-v
if [ "$1" != "upgrade" ]
then
	source=/usr/share/misctools/setuid
	target=/usr/libexec/misctools
	if [ -f $source ]
	then
		cd $target
		for prog in `cat $source`
		do
			if id $prog >/dev/null 2>/dev/null
			then
				U=`id $prog | sed -e 's/^uid=//' -e 's/(.*//'`
				G=`id $prog | sed -e 's/^.*gid=//' -e 's/(.*//'`
				chown $V $U $prog
				chgrp $V $G $prog
				chmod $V ug+s $prog
			fi
		done
	fi
fi

#DEBHELPER#

exit 0
