--- ebuild.sh.orig 2004-04-27 19:33:49.180441698 -0400 +++ ebuild.sh 2004-04-27 20:27:53.209552526 -0400 @@ -848,15 +848,16 @@ # Smart FileSystem Permissions if has sfperms $FEATURES; then - for i in $(find ${IMAGE}/ -type f -perm -4000); do - ebegin ">>> SetUID: [chmod go-r] $i " - chmod go-r "$i" - eend $? - done - for i in $(find ${IMAGE}/ -type f -perm -2000); do - ebegin ">>> SetGID: [chmod o-r] $i " - chmod o-r "$i" - eend $? + for i in $(find ${IMAGE}/ -type f -a \( -perm -4100 -o -perm -4010 -o -perm -4001 -o -perm -2100 -o -perm -2010 -o -perm -2001 \)); do + if [ "`file "$i" | grep \ script\ `" = "" ]; then + ebegin ">>> SetUID/SetGID: [chmod -rw] $i " + chmod -rw "$i" + eend $? + else + ebegin ">>> SetUID/SetGID: [chmod -w] $i " + chmod -w "$i" + eend $? + fi done fi