]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - tools/regression/fstest/tests/chmod/11.t
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / tools / regression / fstest / tests / chmod / 11.t
1 #!/bin/sh
2 # $FreeBSD$
3
4 desc="chmod returns EFTYPE if the effective user ID is not the super-user, the mode includes the sticky bit (S_ISVTX), and path does not refer to a directory"
5
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
8
9 echo "1..20"
10
11 n0=`namegen`
12 n1=`namegen`
13
14 expect 0 mkdir ${n0} 0755
15 cdir=`pwd`
16 cd ${n0}
17
18 expect 0 mkdir ${n1} 0755
19 expect 0 chmod ${n1} 01755
20 expect 01755 stat ${n1} mode
21 expect 0 rmdir ${n1}
22
23 expect 0 create ${n1} 0644
24 expect 0 chmod ${n1} 01644
25 expect 01644 stat ${n1} mode
26 expect 0 unlink ${n1}
27
28 expect 0 mkdir ${n1} 0755
29 expect 0 chown ${n1} 65534 65534
30 expect 0 -u 65534 -g 65534 chmod ${n1} 01755
31 expect 01755 stat ${n1} mode
32 expect 0 rmdir ${n1}
33
34 expect 0 create ${n1} 0644
35 expect 0 chown ${n1} 65534 65534
36 case "${os}" in
37 FreeBSD)
38         expect EFTYPE -u 65534 -g 65534 chmod ${n1} 01644
39         expect 0644 stat ${n1} mode
40         ;;
41 SunOS)
42         expect 0 -u 65534 -g 65534 chmod ${n1} 01644
43         expect 0644 stat ${n1} mode
44         ;;
45 Linux)
46         expect 0 -u 65534 -g 65534 chmod ${n1} 01644
47         expect 01644 stat ${n1} mode
48         ;;
49 esac
50 expect 0 unlink ${n1}
51
52 cd ${cdir}
53 expect 0 rmdir ${n0}