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