find "$@" -print | sort | sed 's/ /\\ /g' | xargs "$TOOLDIR/tls" $TLS_ARGS
}
+get_testuid() {
+ id 2>/dev/null | sed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/'
+}
+
check_perms() {
perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'`
if test $perms = $2; then
eval "$1"
status=$?
if [ $status != 0 ]; then
- failed="YES";
+ failed="$failed status=$status"
fi
echo "-------------"
echo ""
( cd "$2" && rsync_ls_lR . ) > "$tmpdir/ls-from"
( cd "$3" && rsync_ls_lR . ) > "$tmpdir/ls-to"
- diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed=YES
+ diff $diffopt "$tmpdir/ls-from" "$tmpdir/ls-to" || failed="$failed dir-diff"
echo "-------------"
echo "check how the files compare with diff:"
if [ "x$4" != x ]; then
echo " === Skipping (as directed) ==="
else
- diff -r $diffopt "$2" "$3" || failed=YES
+ diff -r $diffopt "$2" "$3" || failed="$failed file-diff"
fi
echo "-------------"
if [ -z "$failed" ] ; then
return 0
- else
- return 1
fi
+
+ echo "Failed: $failed"
+ return 1
}
uid_setting='uid = 0'
gid_setting='gid = 0'
- case `id -u` in
+ case `get_testuid` in
0) ;;
*)
# Non-root cannot specify uid & gid settings