turns printfs back on
[freebsd-src/fkvm-freebsd.git] / tools / regression / fstest / tests / chmod / 11.t
blobf7bc0568c99be452b7e9d860622faf1bcd5ff153
1 #!/bin/sh
2 # $FreeBSD$
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"
6 dir=`dirname $0`
7 . ${dir}/../misc.sh
9 echo "1..20"
11 n0=`namegen`
12 n1=`namegen`
14 expect 0 mkdir ${n0} 0755
15 cdir=`pwd`
16 cd ${n0}
18 expect 0 mkdir ${n1} 0755
19 expect 0 chmod ${n1} 01755
20 expect 01755 stat ${n1} mode
21 expect 0 rmdir ${n1}
23 expect 0 create ${n1} 0644
24 expect 0 chmod ${n1} 01644
25 expect 01644 stat ${n1} mode
26 expect 0 unlink ${n1}
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}
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
41 SunOS)
42 expect 0 -u 65534 -g 65534 chmod ${n1} 01644
43 expect 0644 stat ${n1} mode
45 Linux)
46 expect 0 -u 65534 -g 65534 chmod ${n1} 01644
47 expect 01644 stat ${n1} mode
49 esac
50 expect 0 unlink ${n1}
52 cd ${cdir}
53 expect 0 rmdir ${n0}