Jason's audit one handles most things, and fixes; this is a light, check-only alternative. Useful for non-extension makers to pinpoint which extension has the wrong permissions/owner.
#!/bin/sh
# Tests all mounted extensions for correct tce.installed
cd /tmp/tcloop
for i in *; do
if [ -d "$i"/usr/local/tce.installed ]; then
OUT=$(busybox ls -d -l "$i"/usr/local/tce.installed)
PERM=$(echo $OUT | cut -d" " -f1)
OWNER=$(echo $OUT | cut -d" " -f3-4)
[ "$PERM" != "drwxrwxr-x" ] && [ "$PERM" != "drwxrwsr-x" ] && echo Wrong perms on "$i"
[ "$OWNER" != "root staff" ] && echo Wrong owner on "$i"
fi
done
March 3rd: updated with g+s check