+2008-06-02 Bruno Haible <bruno@clisp.org>
+
+ * tests/test-file-has-acl.sh: Use different code for Cygwin.
+ * tests/test-set-mode-acl.sh: Likewise.
+ * tests/test-copy-acl.sh: Likewise.
+ * tests/test-copy-file.sh: Likewise.
+
2008-06-02 Bruno Haible <bruno@clisp.org>
* tests/test-file-has-acl.sh: Remove unused code.
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
;;
+ 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.
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
;;
+ 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.
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.
if setfacl -m user:$auid:1 tmpfile0; then
fi
;;
+ cygwin)
+
+ # Set an ACL for a group.
+ if setfacl -m group:0:1 tmpfile0; then
+
+ func_test_has_acl tmpfile0 yes
+
+ # Remove the ACL for the group.
+ setfacl -d group:0 tmpfile0
+
+ func_test_has_acl tmpfile0 no
+
+ fi
+ ;;
+
hpux)
# Set an ACL for a user.
# Prepare a file with an ACL.
echo "Special contents" > tmpfile2
chmod 600 tmpfile2
- # Set an ACL for a user.
+ # Set an ACL for a user (or group).
case $acl_flavor in
- linux | cygwin | freebsd | solaris)
+ linux | freebsd | solaris)
setfacl -m user:$auid:1 tmpfile0
;;
+ cygwin)
+ setfacl -m group:0:1 tmpfile0
+ ;;
hpux)
orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
chacl -r "${orig}($auid.%,--x)" tmpfile0