1#!/bin/sh 2# $FreeBSD: src/tools/regression/fstest/tests/chmod/09.t,v 1.1 2007/01/17 01:42:08 pjd Exp $ 3 4desc="chmod returns EROFS if the named file resides on a read-only file system" 5 6n0=`namegen` 7n1=`namegen` 8 9expect 0 mkdir ${n0} 0755 10dd if=/dev/zero of=tmpdisk bs=1k count=1024 status=none 11vnconfig vnd1 tmpdisk 12newfs /dev/rvnd1c >/dev/null 13mount /dev/vnd1c ${n0} 14expect 0 create ${n0}/${n1} 0644 15expect 0 chmod ${n0}/${n1} 0640 16expect 0640 stat ${n0}/${n1} mode 17mount -ur /dev/vnd1c 18expect EROFS chmod ${n0}/${n1} 0600 19expect 0640 stat ${n0}/${n1} mode 20mount -uw /dev/vnd1c 21expect 0 chmod ${n0}/${n1} 0600 22expect 0600 stat ${n0}/${n1} mode 23expect 0 unlink ${n0}/${n1} 24umount /dev/vnd1c 25vnconfig -u vnd1 26rm tmpdisk 27expect 0 rmdir ${n0} 28