07.t revision 1.1
1#!/bin/sh 2# $FreeBSD: src/tools/regression/fstest/tests/open/07.t,v 1.1 2007/01/17 01:42:10 pjd Exp $ 3 4desc="open returns EACCES when O_TRUNC is specified and write permission is denied" 5 6n0=`namegen` 7n1=`namegen` 8 9expect 0 mkdir ${n0} 0755 10expect 0 chown ${n0} 65534 65534 11cdir=`pwd` 12cd ${n0} 13 14expect 0 -u 65534 -g 65534 create ${n1} 0644 15 16expect 0 -u 65534 -g 65534 chmod ${n1} 0477 17expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY,O_TRUNC 18expect 0 -u 65534 -g 65534 chmod ${n1} 0747 19expect EACCES -u 65533 -g 65534 open ${n1} O_RDONLY,O_TRUNC 20expect 0 -u 65534 -g 65534 chmod ${n1} 0774 21expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY,O_TRUNC 22 23expect 0 -u 65534 -g 65534 chmod ${n1} 0177 24expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY,O_TRUNC 25expect 0 -u 65534 -g 65534 chmod ${n1} 0717 26expect EACCES -u 65533 -g 65534 open ${n1} O_RDONLY,O_TRUNC 27expect 0 -u 65534 -g 65534 chmod ${n1} 0771 28expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY,O_TRUNC 29 30expect 0 -u 65534 -g 65534 chmod ${n1} 0077 31expect EACCES -u 65534 -g 65534 open ${n1} O_RDONLY,O_TRUNC 32expect 0 -u 65534 -g 65534 chmod ${n1} 0707 33expect EACCES -u 65533 -g 65534 open ${n1} O_RDONLY,O_TRUNC 34expect 0 -u 65534 -g 65534 chmod ${n1} 0770 35expect EACCES -u 65533 -g 65533 open ${n1} O_RDONLY,O_TRUNC 36 37expect 0 -u 65534 -g 65534 unlink ${n1} 38 39cd ${cdir} 40expect 0 rmdir ${n0} 41