]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Improved check_perms() to work with a directory, to have better
authorWayne Davison <wayned@samba.org>
Fri, 3 Feb 2006 17:54:18 +0000 (17:54 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 3 Feb 2006 17:54:18 +0000 (17:54 +0000)
output on error, and to call test_fail on error.

testsuite/rsync.fns

index a1902b70ddcef51e391d119029db103f86e091a2..73e36eed1cc153b7d830b7ccbc653376319ff93e 100644 (file)
@@ -70,7 +70,13 @@ rsync_ls_lR() {
 }
 
 check_perms() {
-    "$TOOLDIR/tls" "$1" | grep "^-$2" >/dev/null
+    perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'`
+    if test $perms = $2; then
+       return 0
+    fi
+    echo "permissions: $perms on $1"
+    echo "should be:   $2"
+    test_fail "failed test $3"
 }
 
 rsync_getgroups() {