annotate tests/test-copy-acl.sh @ 40156:066c585853e5

tests: Accommodate a shell that is not in /bin/sh. * tests/init.sh (setup_): Set srcdir and builddir. (BOURNE_SHELL): New variable. * modules/acl-tests (Depends-on): Add 'test-framework-sh'. * modules/file-has-acl-tests (Depends-on): Likewise. * modules/copy-file-tests (Depends-on): Likewise. * tests/test-set-mode-acl-1.sh: Use the test framework. Invoke shell scripts through $BOURNE_SHELL. * tests/test-set-mode-acl-2.sh: Likewise. * tests/test-copy-acl-1.sh: Likewise. * tests/test-copy-acl-2.sh: Likewise. * tests/test-file-has-acl-1.sh: Likewise. * tests/test-file-has-acl-2.sh: Likewise. * tests/test-copy-file-1.sh: Likewise. * tests/test-copy-file-2.sh: Likewise. * tests/test-set-mode-acl.sh (builddir): Consider value set by the invoker. * tests/test-copy-acl.sh (builddir): Likewise. * tests/test-file-has-acl.sh (builddir): Likewise. * tests/test-copy-file.sh (builddir): Likewise. * tests/test-vc-list-files-cvs.sh: Don't create shims for executables in build-aux/. Instead, invoke shell scripts through $BOURNE_SHELL. * tests/test-vc-list-files-git.sh: Likewise.
author Bruno Haible <bruno@clisp.org>
date Sun, 27 Jan 2019 16:01:23 +0100
parents 498a2211d839
children 8c1a17df67e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 #!/bin/sh
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 # Show all commands when run with environment variable VERBOSE=yes.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 test -z "$VERBOSE" || set -x
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
10444
e7595530873e avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 10149
diff changeset
6 test "$USE_ACL" = 0 &&
e7595530873e avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 10149
diff changeset
7 {
e7595530873e avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 10149
diff changeset
8 echo "Skipping test: insufficient ACL support"
e7595530873e avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 10149
diff changeset
9 exit 77
e7595530873e avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 10149
diff changeset
10 }
e7595530873e avoid spurious test failure when library is built without ACL support
Jim Meyering <meyering@redhat.com>
parents: 10149
diff changeset
11
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 # func_tmpdir
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 # creates a temporary directory.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 # Sets variable
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 # - tmp pathname of freshly created temporary directory
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 func_tmpdir ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 # Use the environment variable TMPDIR, falling back to /tmp. This allows
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 # users to specify a different temporary directory, for example, if their
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 # /tmp is filled up or too small.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 : ${TMPDIR=/tmp}
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 # Use the mktemp program if available. If not available, hide the error
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 # message.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 tmp=`(umask 077 && mktemp -d "$TMPDIR/glXXXXXX") 2>/dev/null` &&
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 test -n "$tmp" && test -d "$tmp"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 } ||
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 # Use a simple mkdir command. It is guaranteed to fail if the directory
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 # already exists. $RANDOM is bash specific and expands to empty in shells
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 # other than bash, ksh and zsh. Its use does not increase security;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 # rather, it minimizes the probability of failure in a very cluttered /tmp
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # directory.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 tmp=$TMPDIR/gl$$-$RANDOM
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 (umask 077 && mkdir "$tmp")
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 } ||
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 echo "$0: cannot create a temporary directory in $TMPDIR" >&2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 exit 1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 func_tmpdir
40156
066c585853e5 tests: Accommodate a shell that is not in /bin/sh.
Bruno Haible <bruno@clisp.org>
parents: 16935
diff changeset
44 # builddir may already be set by the script that invokes this one.
066c585853e5 tests: Accommodate a shell that is not in /bin/sh.
Bruno Haible <bruno@clisp.org>
parents: 16935
diff changeset
45 case "$builddir" in
066c585853e5 tests: Accommodate a shell that is not in /bin/sh.
Bruno Haible <bruno@clisp.org>
parents: 16935
diff changeset
46 '') builddir=`pwd` ;;
066c585853e5 tests: Accommodate a shell that is not in /bin/sh.
Bruno Haible <bruno@clisp.org>
parents: 16935
diff changeset
47 /* | ?:*) ;;
066c585853e5 tests: Accommodate a shell that is not in /bin/sh.
Bruno Haible <bruno@clisp.org>
parents: 16935
diff changeset
48 *) builddir=`pwd`/$builddir ;;
066c585853e5 tests: Accommodate a shell that is not in /bin/sh.
Bruno Haible <bruno@clisp.org>
parents: 16935
diff changeset
49 esac
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 cd "$builddir" ||
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 echo "$0: cannot determine build directory (unreadable parent dir?)" >&2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 exit 1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 # Switch to a temporary directory, to increase the likelihood that ACLs are
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 # supported on the current file system. (/tmp is usually locally mounted,
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 # whereas the build dir is sometimes NFS-mounted.)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 ( cd "$tmp"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 # Prepare tmpfile0.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 rm -f tmpfile[0-9] tmpaclout[0-2]
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 echo "Simple contents" > tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 chmod 600 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 # Classification of the platform according to the programs available for
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 # manipulating ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 # Possible values are:
14905
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
68 # linux, cygwin, freebsd, solaris, hpux, hpuxjfs, osf1, aix, macosx, irix, none.
16214
ec738d6aeef5 Talk about "native Windows API", not "Win32".
Bruno Haible <bruno@clisp.org>
parents: 14905
diff changeset
69 # TODO: Support also native Windows platforms (mingw).
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 acl_flavor=none
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 if (getfacl tmpfile0 >/dev/null) 2>/dev/null; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 # Platforms with the getfacl and setfacl programs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 # Linux, FreeBSD, Solaris, Cygwin.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 if (setfacl --help >/dev/null) 2>/dev/null; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 # Linux, Cygwin.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 if (LC_ALL=C setfacl --help | grep ' --set-file' >/dev/null) 2>/dev/null; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 # Linux.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 acl_flavor=linux
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 acl_flavor=cygwin
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 # FreeBSD, Solaris.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 if (LC_ALL=C setfacl 2>&1 | grep '\-x entries' >/dev/null) 2>/dev/null; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 # FreeBSD.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 acl_flavor=freebsd
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 # Solaris.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 acl_flavor=solaris
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 if (lsacl / >/dev/null) 2>/dev/null; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 # Platforms with the lsacl and chacl programs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 # HP-UX, sometimes also IRIX.
14905
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
96 if (getacl tmpfile0 >/dev/null) 2>/dev/null; then
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
97 # HP-UX 11.11 or newer.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
98 acl_flavor=hpuxjfs
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
99 else
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
100 # HP-UX 11.00.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
101 acl_flavor=hpux
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
102 fi
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 if (getacl tmpfile0 >/dev/null) 2>/dev/null; then
13757
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
105 # Tru64, NonStop Kernel.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
106 if (getacl -m tmpfile0 >/dev/null) 2>/dev/null; then
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
107 # Tru64.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
108 acl_flavor=osf1
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
109 else
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
110 # NonStop Kernel.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
111 acl_flavor=nsk
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
112 fi
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 if (aclget tmpfile0 >/dev/null) 2>/dev/null; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 # AIX.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 acl_flavor=aix
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118 if (fsaclctl -v >/dev/null) 2>/dev/null; then
16935
498a2211d839 Write "Mac OS X" instead of "MacOS X".
Bruno Haible <bruno@clisp.org>
parents: 16214
diff changeset
119 # Mac OS X.
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 acl_flavor=macosx
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 else
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 if test -f /sbin/chacl; then
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 # IRIX.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 acl_flavor=irix
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 # Define a function to test for the same ACLs, from the point of view of
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 # the programs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134 # func_test_same_acls file1 file2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 linux | cygwin | freebsd | solaris)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
139 getfacl "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 getfacl "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 cmp tmpaclout1 tmpaclout2 > /dev/null
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144 hpux)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 lsacl "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 lsacl "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 cmp tmpaclout1 tmpaclout2 > /dev/null
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151 ;;
14905
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
152 hpuxjfs)
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
153 func_test_same_acls ()
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
154 {
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
155 { lsacl "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
156 lsacl "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
157 cmp tmpaclout1 tmpaclout2 > /dev/null
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
158 } &&
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
159 { getacl "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
160 getacl "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
161 cmp tmpaclout1 tmpaclout2 > /dev/null
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
162 }
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
163 }
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
164 ;;
13757
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
165 osf1 | nsk)
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 getacl "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 getacl "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170 cmp tmpaclout1 tmpaclout2 > /dev/null
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
172 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
173 aix)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
174 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
175 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
176 aclget "$1" > tmpaclout1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
177 aclget "$2" > tmpaclout2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
178 cmp tmpaclout1 tmpaclout2 > /dev/null
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
179 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
180 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
181 macosx)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
182 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
183 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
184 /bin/ls -le "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
185 /bin/ls -le "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
186 cmp tmpaclout1 tmpaclout2 > /dev/null
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
187 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
188 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
189 irix)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
190 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
191 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
192 /bin/ls -lD "$1" | sed -e "s/$1/FILENAME/g" > tmpaclout1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
193 /bin/ls -lD "$2" | sed -e "s/$2/FILENAME/g" > tmpaclout2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
194 cmp tmpaclout1 tmpaclout2 > /dev/null
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
195 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
196 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
197 none)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
198 func_test_same_acls ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
199 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
200 :
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
201 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
202 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
203 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
204
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
205 # func_test_copy file1 file2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
206 # copies file1 to file2 and verifies the permissions and ACLs are the same
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
207 # on both.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
208 func_test_copy ()
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
209 {
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
210 echo "Simple contents" > "$2"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
211 chmod 600 "$2"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
212 "$builddir"/test-copy-acl${EXEEXT} "$1" "$2" || exit 1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
213 "$builddir"/test-sameacls${EXEEXT} "$1" "$2" || exit 1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
214 func_test_same_acls "$1" "$2" || exit 1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
215 }
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
216
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
217 func_test_copy tmpfile0 tmpfile1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
218
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
219 if test $acl_flavor != none; then
11914
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
220 # A POSIX compliant 'id' program.
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
221 if test -f /usr/xpg4/bin/id; then
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
222 ID=/usr/xpg4/bin/id
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
223 else
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
224 ID=id
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
225 fi
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
226 # Use a user and group id different from the current one, to avoid
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
227 # redundant/ambiguous ACLs.
11914
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
228 myuid=`$ID -u`
e9cf9c46ad7a Work around deficient /usr/bin/id program on Solaris.
Bruno Haible <bruno@clisp.org>
parents: 10444
diff changeset
229 mygid=`$ID -g`
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
230 auid=1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
231 if test "$auid" = "$myuid"; then auid=2; fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
232 agid=1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
233 if test "$agid" = "$mygid"; then agid=2; fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
234
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
235 case $acl_flavor in
10149
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
236 linux | freebsd | solaris)
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
237
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
238 # Set an ACL for a user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
239 setfacl -m user:$auid:1 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
240
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
241 func_test_copy tmpfile0 tmpfile2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
242
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
243 # Set an ACL for a group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
244 setfacl -m group:$agid:4 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
245
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
246 func_test_copy tmpfile0 tmpfile3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
247
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
248 # Set an ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
249 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
250 freebsd) setfacl -m other::4 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
251 solaris) chmod o+r tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
252 *) setfacl -m other:4 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
253 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
254
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
255 func_test_copy tmpfile0 tmpfile4
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
256
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
257 # Remove the ACL for the user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
258 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
259 linux) setfacl -x user:$auid tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
260 freebsd) setfacl -x user:$auid:1 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
261 *) setfacl -d user:$auid:1 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
262 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
263
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
264 func_test_copy tmpfile0 tmpfile5
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
265
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
266 # Remove the ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
267 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
268 linux | solaris) ;; # impossible
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
269 freebsd) setfacl -x other::4 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
270 *) setfacl -d other:4 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
271 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
272
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
273 func_test_copy tmpfile0 tmpfile6
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
274
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
275 # Remove the ACL for the group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
276 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
277 linux) setfacl -x group:$agid tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
278 freebsd) setfacl -x group:$agid:4 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
279 *) setfacl -d group:$agid:4 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
280 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
281
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
282 func_test_copy tmpfile0 tmpfile7
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
283
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
284 # Delete all optional ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
285 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
286 linux | freebsd)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
287 setfacl -m user:$auid:1 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
288 setfacl -b tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
289 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
290 *)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
291 setfacl -s user::6,group::0,other:0 tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
292 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
293
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
294 func_test_copy tmpfile0 tmpfile8
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
295
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
296 # Copy ACLs from a file that has no ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
297 echo > tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
298 chmod a+x tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
299 case $acl_flavor in
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
300 linux) getfacl tmpfile9 | setfacl --set-file=- tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
301 freebsd) ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
302 *) getfacl tmpfile9 | setfacl -f - tmpfile0 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
303 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
304 rm -f tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
305
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
306 func_test_copy tmpfile0 tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
307
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
308 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
309
10149
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
310 cygwin)
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
311
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
312 # Set an ACL for a group.
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
313 setfacl -m group:0:1 tmpfile0
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
314
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
315 func_test_copy tmpfile0 tmpfile2
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
316
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
317 # Set an ACL for other.
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
318 setfacl -m other:4 tmpfile0
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
319
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
320 func_test_copy tmpfile0 tmpfile4
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
321
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
322 # Remove the ACL for the group.
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
323 setfacl -d group:0 tmpfile0
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
324
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
325 func_test_copy tmpfile0 tmpfile5
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
326
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
327 # Remove the ACL for other.
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
328 setfacl -d other:4 tmpfile0
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
329
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
330 func_test_copy tmpfile0 tmpfile6
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
331
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
332 # Delete all optional ACLs.
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
333 setfacl -s user::6,group::0,other:0 tmpfile0
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
334
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
335 func_test_copy tmpfile0 tmpfile8
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
336
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
337 # Copy ACLs from a file that has no ACLs.
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
338 echo > tmpfile9
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
339 chmod a+x tmpfile9
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
340 getfacl tmpfile9 | setfacl -f - tmpfile0
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
341 rm -f tmpfile9
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
342
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
343 func_test_copy tmpfile0 tmpfile9
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
344
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
345 ;;
2f94bd2a861d Use different test code for Cygwin.
Bruno Haible <bruno@clisp.org>
parents: 10142
diff changeset
346
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
347 hpux)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
348
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
349 # Set an ACL for a user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
350 orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
351 chacl -r "${orig}($auid.%,--x)" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
352
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
353 func_test_copy tmpfile0 tmpfile2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
354
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
355 # Set an ACL for a group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
356 orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
357 chacl -r "${orig}(%.$agid,r--)" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
358
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
359 func_test_copy tmpfile0 tmpfile3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
360
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
361 # Set an ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
362 orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
363 chacl -r "${orig}(%.%,r--)" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
364
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
365 func_test_copy tmpfile0 tmpfile4
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
366
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
367 # Remove the ACL for the user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
368 chacl -d "($auid.%,--x)" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
369
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
370 func_test_copy tmpfile0 tmpfile5
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
371
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
372 # Remove the ACL for the group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
373 chacl -d "(%.$agid,r--)" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
374
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
375 func_test_copy tmpfile0 tmpfile6
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
376
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
377 # Delete all optional ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
378 chacl -z tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
379
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
380 func_test_copy tmpfile0 tmpfile8
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
381
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
382 # Copy ACLs from a file that has no ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
383 echo > tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
384 chmod a+x tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
385 orig=`lsacl tmpfile9 | sed -e 's/ tmpfile9$//'`
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
386 rm -f tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
387 chacl -r "${orig}" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
388
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
389 func_test_copy tmpfile0 tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
390
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
391 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
392
14905
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
393 hpuxjfs)
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
394
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
395 # Set an ACL for a user.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
396 orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
397 chacl -r "${orig}($auid.%,--x)" tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
398 || setacl -m user:$auid:1 tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
399
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
400 func_test_copy tmpfile0 tmpfile2
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
401
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
402 # Set an ACL for a group.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
403 orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
404 chacl -r "${orig}(%.$agid,r--)" tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
405 || setacl -m group:$agid:4 tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
406
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
407 func_test_copy tmpfile0 tmpfile3
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
408
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
409 # Set an ACL for other.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
410 orig=`lsacl tmpfile0 | sed -e 's/ tmpfile0$//'`
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
411 chacl -r "${orig}(%.%,r--)" tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
412 || setacl -m other:4 tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
413
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
414 func_test_copy tmpfile0 tmpfile4
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
415
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
416 # Remove the ACL for the user.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
417 chacl -d "($auid.%,--x)" tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
418 || setacl -d user:$auid tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
419
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
420 func_test_copy tmpfile0 tmpfile5
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
421
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
422 # Remove the ACL for the group.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
423 chacl -d "(%.$agid,r--)" tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
424 || setacl -d group:$agid tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
425
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
426 func_test_copy tmpfile0 tmpfile6
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
427
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
428 # Delete all optional ACLs.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
429 chacl -z tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
430 || { setacl -m user:$auid:1 tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
431 setacl -s user::6,group::0,class:7,other:0 tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
432 }
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
433
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
434 func_test_copy tmpfile0 tmpfile8
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
435
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
436 # Copy ACLs from a file that has no ACLs.
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
437 echo > tmpfile9
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
438 chmod a+x tmpfile9
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
439 orig=`lsacl tmpfile9 | sed -e 's/ tmpfile9$//'`
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
440 getacl tmpfile9 > tmpaclout0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
441 rm -f tmpfile9
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
442 chacl -r "${orig}" tmpfile0 \
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
443 || setacl -f tmpaclout0 tmpfile0
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
444
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
445 func_test_copy tmpfile0 tmpfile9
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
446
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
447 ;;
a9b67d6b93df acl: Add support for HP-UX >= 11.11 JFS ACLs.
Bruno Haible <bruno@clisp.org>
parents: 13757
diff changeset
448
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
449 osf1)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
450
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
451 # Set an ACL for a user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
452 setacl -u user:$auid:1 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
453
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
454 func_test_copy tmpfile0 tmpfile2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
455
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
456 # Set an ACL for a group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
457 setacl -u group:$agid:4 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
458
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
459 func_test_copy tmpfile0 tmpfile3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
460
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
461 # Set an ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
462 setacl -u other::4 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
463
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
464 func_test_copy tmpfile0 tmpfile4
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
465
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
466 # Remove the ACL for the user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
467 setacl -x user:$auid:1 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
468
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
469 func_test_copy tmpfile0 tmpfile5
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
470
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
471 if false; then # would give an error "can't set ACL: Invalid argument"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
472 # Remove the ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
473 setacl -x other::4 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
474
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
475 func_test_copy tmpfile0 tmpfile6
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
476 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
477
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
478 # Remove the ACL for the group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
479 setacl -x group:$agid:4 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
480
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
481 func_test_copy tmpfile0 tmpfile7
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
482
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
483 # Delete all optional ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
484 setacl -u user:$auid:1 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
485 setacl -b tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
486
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
487 func_test_copy tmpfile0 tmpfile8
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
488
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
489 # Copy ACLs from a file that has no ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
490 echo > tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
491 chmod a+x tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
492 getacl tmpfile9 > tmpaclout0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
493 setacl -b -U tmpaclout0 tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
494 rm -f tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
495
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
496 func_test_copy tmpfile0 tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
497
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
498 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
499
13757
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
500 nsk)
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
501
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
502 # Set an ACL for a user.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
503 setacl -m user:$auid:1 tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
504
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
505 func_test_copy tmpfile0 tmpfile2
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
506
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
507 # Set an ACL for a group.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
508 setacl -m group:$agid:4 tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
509
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
510 func_test_copy tmpfile0 tmpfile3
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
511
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
512 # Set an ACL for other.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
513 setacl -m other:4 tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
514
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
515 func_test_copy tmpfile0 tmpfile4
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
516
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
517 # Remove the ACL for the user.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
518 setacl -d user:$auid tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
519
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
520 func_test_copy tmpfile0 tmpfile5
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
521
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
522 # Remove the ACL for the group.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
523 setacl -d group:$agid tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
524
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
525 func_test_copy tmpfile0 tmpfile6
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
526
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
527 # Delete all optional ACLs.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
528 setacl -m user:$auid:1 tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
529 setacl -s user::6,group::0,class:7,other:0 tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
530
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
531 func_test_copy tmpfile0 tmpfile8
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
532
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
533 # Copy ACLs from a file that has no ACLs.
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
534 echo > tmpfile9
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
535 chmod a+x tmpfile9
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
536 getacl tmpfile9 > tmpaclout0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
537 setacl -f tmpaclout0 tmpfile0
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
538 rm -f tmpfile9
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
539
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
540 func_test_copy tmpfile0 tmpfile9
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
541
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
542 ;;
87aaf9340686 acl: Add support for ACLs on NonStop Kernel.
Bruno Haible <bruno@clisp.org>
parents: 11914
diff changeset
543
10142
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
544 aix)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
545
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
546 # Set an ACL for a user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
547 { aclget tmpfile0 | sed -e 's/disabled$/enabled/'; echo " permit --x u:$auid"; } | aclput tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
548
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
549 func_test_copy tmpfile0 tmpfile2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
550
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
551 # Set an ACL for a group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
552 { aclget tmpfile0 | sed -e 's/disabled$/enabled/'; echo " permit r-- g:$agid"; } | aclput tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
553
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
554 func_test_copy tmpfile0 tmpfile3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
555
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
556 # Set an ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
557 chmod o+r tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
558
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
559 func_test_copy tmpfile0 tmpfile4
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
560
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
561 # Remove the ACL for the user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
562 aclget tmpfile0 | grep -v ' u:[^ ]*$' | aclput tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
563
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
564 func_test_copy tmpfile0 tmpfile5
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
565
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
566 # Remove the ACL for the group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
567 aclget tmpfile0 | grep -v ' g:[^ ]*$' | aclput tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
568
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
569 func_test_copy tmpfile0 tmpfile7
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
570
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
571 # Delete all optional ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
572 aclget tmpfile0 | sed -e 's/enabled$/disabled/' | sed -e '/disabled$/q' | aclput tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
573
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
574 func_test_copy tmpfile0 tmpfile8
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
575
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
576 # Copy ACLs from a file that has no ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
577 echo > tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
578 chmod a+x tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
579 aclget tmpfile9 | aclput tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
580 rm -f tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
581
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
582 func_test_copy tmpfile0 tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
583
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
584 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
585
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
586 macosx)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
587
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
588 # Set an ACL for a user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
589 /bin/chmod +a "user:daemon allow execute" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
590
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
591 func_test_copy tmpfile0 tmpfile2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
592
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
593 # Set an ACL for a group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
594 /bin/chmod +a "group:daemon allow read" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
595
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
596 func_test_copy tmpfile0 tmpfile3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
597
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
598 # Set an ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
599 chmod o+r tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
600
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
601 func_test_copy tmpfile0 tmpfile4
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
602
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
603 # Remove the ACL for the user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
604 /bin/chmod -a "user:daemon allow execute" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
605
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
606 func_test_copy tmpfile0 tmpfile5
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
607
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
608 # Remove the ACL for the group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
609 /bin/chmod -a "group:daemon allow read" tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
610
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
611 func_test_copy tmpfile0 tmpfile7
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
612
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
613 # Delete all optional ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
614 /bin/chmod -N tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
615
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
616 func_test_copy tmpfile0 tmpfile8
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
617
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
618 # Copy ACLs from a file that has no ACLs.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
619 echo > tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
620 chmod a+x tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
621 { /bin/ls -le tmpfile9 | sed -n -e 's/^ [0-9][0-9]*: //p'; echo; } | /bin/chmod -E tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
622 rm -f tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
623
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
624 func_test_copy tmpfile0 tmpfile9
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
625
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
626 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
627
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
628 irix)
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
629
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
630 # Set an ACL for a user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
631 /sbin/chacl user::rw-,group::---,other::---,user:$auid:--x tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
632
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
633 func_test_copy tmpfile0 tmpfile2
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
634
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
635 # Set an ACL for a group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
636 /sbin/chacl user::rw-,group::---,other::---,user:$auid:--x,group:$agid:r-- tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
637
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
638 func_test_copy tmpfile0 tmpfile3
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
639
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
640 # Set an ACL for other.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
641 /sbin/chacl user::rw-,group::---,user:$auid:--x,group:$agid:r--,other::r-- tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
642
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
643 func_test_copy tmpfile0 tmpfile4
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
644
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
645 # Remove the ACL for the user.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
646 /sbin/chacl user::rw-,group::---,group:$agid:r--,other::r-- tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
647
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
648 func_test_copy tmpfile0 tmpfile5
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
649
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
650 # Remove the ACL for the group.
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
651 /sbin/chacl user::rw-,group::---,other::r-- tmpfile0
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
652
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
653 func_test_copy tmpfile0 tmpfile7
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
654
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
655 ;;
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
656
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
657 esac
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
658 fi
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
659
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
660 rm -f tmpfile[0-9] tmpaclout[0-2]
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
661 ) || exit 1
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
662
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
663 rm -rf "$tmp"
dc740b83408a New ACL unit tests.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
664 exit 0