X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-copy-file.sh;h=58f9df455e35f791b8684af065475df3f159080b;hb=7bf5395a54d50724481ea61a5e9ef51144e28ace;hp=722e50986df33e42690912d8684635c7fdd03c6a;hpb=484b7b9619c44372309c74a6cddd42e855dbb76d;p=gnulib.git diff --git a/tests/test-copy-file.sh b/tests/test-copy-file.sh index 722e50986..58f9df455 100755 --- a/tests/test-copy-file.sh +++ b/tests/test-copy-file.sh @@ -47,7 +47,7 @@ cd "$builddir" || ( cd "$tmp" # Prepare tmpfile0. - rm -f tmpfile[0-9] tmpaclout[12] + rm -f tmpfile[0-9] tmpaclout[0-2] echo "Simple contents" > tmpfile0 chmod 600 tmpfile0 @@ -79,7 +79,7 @@ cd "$builddir" || fi fi else - if (lsacl tmpfile0 >/dev/null) 2>/dev/null; then + if (lsacl / >/dev/null) 2>/dev/null; then # Platforms with the lsacl and chacl programs. # HP-UX, sometimes also IRIX. acl_flavor=hpux @@ -171,9 +171,9 @@ cd "$builddir" || # on both. func_test_copy () { - "$builddir"/test-copy-file${EXEEXT} "$1" "$2" || exit 1 - "$builddir"/test-copy-file-sameacls${EXEEXT} "$1" "$2" || exit 1 - func_test_same_acls "$1" "$2" || exit 1 + "$builddir"/test-copy-file${EXEEXT} "$1" "$2" || exit 1 + "$builddir"/test-sameacls${EXEEXT} "$1" "$2" || exit 1 + func_test_same_acls "$1" "$2" || exit 1 } func_test_copy tmpfile0 tmpfile1 @@ -189,7 +189,7 @@ cd "$builddir" || if test "$agid" = "$mygid"; then agid=2; fi case $acl_flavor in - linux | cygwin | freebsd | solaris) + linux | freebsd | solaris) # Set an ACL for a user. setfacl -m user:$auid:1 tmpfile0 @@ -221,7 +221,7 @@ cd "$builddir" || # Remove the ACL for other. case $acl_flavor in - linux) ;; # impossible + linux | solaris) ;; # impossible freebsd) setfacl -x other::4 tmpfile0 ;; *) setfacl -d other:4 tmpfile0 ;; esac @@ -263,6 +263,43 @@ cd "$builddir" || ;; + cygwin) + + # Set an ACL for a group. + setfacl -m group:0:1 tmpfile0 + + func_test_copy tmpfile0 tmpfile2 + + # Set an ACL for other. + setfacl -m other:4 tmpfile0 + + func_test_copy tmpfile0 tmpfile4 + + # Remove the ACL for the group. + setfacl -d group:0 tmpfile0 + + func_test_copy tmpfile0 tmpfile5 + + # Remove the ACL for other. + setfacl -d other:4 tmpfile0 + + func_test_copy tmpfile0 tmpfile6 + + # Delete all optional ACLs. + setfacl -s user::6,group::0,other:0 tmpfile0 + + func_test_copy tmpfile0 tmpfile8 + + # Copy ACLs from a file that has no ACLs. + echo > tmpfile9 + chmod a+x tmpfile9 + getfacl tmpfile9 | setfacl -f - tmpfile0 + rm -f tmpfile9 + + func_test_copy tmpfile0 tmpfile9 + + ;; + hpux) # Set an ACL for a user. @@ -322,7 +359,7 @@ cd "$builddir" || func_test_copy tmpfile0 tmpfile3 # Set an ACL for other. - setacl -u other:4 tmpfile0 + setacl -u other::4 tmpfile0 func_test_copy tmpfile0 tmpfile4 @@ -331,10 +368,12 @@ cd "$builddir" || func_test_copy tmpfile0 tmpfile5 - # Remove the ACL for other. - setacl -x other:4 tmpfile0 + if false; then # would give an error "can't set ACL: Invalid argument" + # Remove the ACL for other. + setacl -x other::4 tmpfile0 - func_test_copy tmpfile0 tmpfile6 + func_test_copy tmpfile0 tmpfile6 + fi # Remove the ACL for the group. setacl -x group:$agid:4 tmpfile0 @@ -350,7 +389,8 @@ cd "$builddir" || # Copy ACLs from a file that has no ACLs. echo > tmpfile9 chmod a+x tmpfile9 - getacl tmpfile9 | setacl -b -U - tmpfile0 + getacl tmpfile9 > tmpaclout0 + setacl -b -U tmpaclout0 tmpfile0 rm -f tmpfile9 func_test_copy tmpfile0 tmpfile9 @@ -444,32 +484,27 @@ cd "$builddir" || irix) # Set an ACL for a user. - /sbin/chacl user:$auid:--x tmpfile0 + /sbin/chacl user::rw-,group::---,other::---,user:$auid:--x tmpfile0 func_test_copy tmpfile0 tmpfile2 # Set an ACL for a group. - /sbin/chacl user:$auid:--x,group:$agid:r-- tmpfile0 + /sbin/chacl user::rw-,group::---,other::---,user:$auid:--x,group:$agid:r-- tmpfile0 func_test_copy tmpfile0 tmpfile3 # Set an ACL for other. - /sbin/chacl user:$auid:--x,group:$agid:r--,other::r-- tmpfile0 + /sbin/chacl user::rw-,group::---,user:$auid:--x,group:$agid:r--,other::r-- tmpfile0 func_test_copy tmpfile0 tmpfile4 # Remove the ACL for the user. - /sbin/chacl group:$agid:r--,other::r-- tmpfile0 + /sbin/chacl user::rw-,group::---,group:$agid:r--,other::r-- tmpfile0 func_test_copy tmpfile0 tmpfile5 - # Remove the ACL for other. - /sbin/chacl group:$agid:r-- tmpfile0 - - func_test_copy tmpfile0 tmpfile6 - # Remove the ACL for the group. - /sbin/chacl , tmpfile0 + /sbin/chacl user::rw-,group::---,other::r-- tmpfile0 func_test_copy tmpfile0 tmpfile7 @@ -478,7 +513,7 @@ cd "$builddir" || esac fi - rm -f tmpfile[0-9] tmpaclout[12] + rm -f tmpfile[0-9] tmpaclout[0-2] ) || exit 1 rm -rf "$tmp"