Whamcloud - gitweb
9a7ea431eceb4c47c21852dcbb4ee3e892448d5b
[fs/lustre-release.git] / lustre / tests / acl / cp.test
1 The cp utility should only copy ACLs if `-p' is given.
2  
3         $ umask 022
4         $ mkdir d
5         $ cd d
6         $ touch f
7         $ setfacl -m u:bin:rw f
8         $ ls -l f | awk -- '{ print $1 }'
9         > -rw-rw-r--+
10         
11         $ cp f g
12         $ ls -l g | awk -- '{ print $1 }'
13         > -rw-r--r--
14         
15         $ rm g
16         $ cp -p f g
17         $ ls -l f | awk -- '{ print $1 }'
18         > -rw-rw-r--+
19         
20         $ mkdir h
21         $ echo blubb > h/x
22         $ cp -rp h i
23         $ cat i/x
24         > blubb
25
26         $ rm -r i
27
28 Use to be "$setfacl -R -m u:bin:rwX h", but RHEL4 uncorrectly set the x flag,
29 so we change to the following test
30
31         $ setfacl -R -m u:bin:rwx h
32         $ getfacl --omit-header h/x
33         > user::rw-
34         > user:bin:rwx
35         > group::r--
36         > mask::rwx
37         > other::r--
38         >
39
40         $ cp -rp h i
41         $ getfacl --omit-header i/x
42         > user::rw-
43         > user:bin:rwx
44         > group::r--
45         > mask::rwx
46         > other::r--
47         >
48
49         $ cd ..
50         $ rm -r d