12834Swollman#!/bin/sh
22834Swollman# $FreeBSD: src/tools/regression/fstest/tests/chmod/11.t,v 1.1 2007/01/17 01:42:08 pjd Exp $
32834Swollman
42834Swollmandesc="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"
52834Swollman
62834Swollmann0=`namegen`
72834Swollmann1=`namegen`
82834Swollman
92834Swollmanexpect 0 mkdir ${n0} 0755
10cdir=`pwd`
11cd ${n0}
12
13expect 0 mkdir ${n1} 0755
14expect 0 chmod ${n1} 01755
15expect 01755 stat ${n1} mode
16expect 0 rmdir ${n1}
17
18expect 0 create ${n1} 0644
19expect 0 chmod ${n1} 01644
20expect 01644 stat ${n1} mode
21expect 0 unlink ${n1}
22
23expect 0 mkdir ${n1} 0755
24expect 0 chown ${n1} 65534 65534
25expect 0 -u 65534 -g 65534 chmod ${n1} 01755
26expect 01755 stat ${n1} mode
27expect 0 rmdir ${n1}
28
29expect 0 create ${n1} 0644
30expect 0 chown ${n1} 65534 65534
31expect EFTYPE -u 65534 -g 65534 chmod ${n1} 01644
32expect 0644 stat ${n1} mode
33expect 0 unlink ${n1}
34
35cd ${cdir}
36expect 0 rmdir ${n0}
37