1271294Sngie#!/bin/sh 2271294Sngie# $FreeBSD: head/tools/regression/pjdfstest/tests/chmod/09.t 211352 2010-08-15 21:24:17Z pjd $ 3271294Sngie 4271294Sngiedesc="chmod returns EROFS if the named file resides on a read-only file system" 5271294Sngie 6271294Sngiedir=`dirname $0` 7271294Sngie. ${dir}/../misc.sh 8271294Sngie 9271294Sngie[ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit 10271294Sngie 11271294Sngieecho "1..15" 12271294Sngie 13271294Sngien0=`namegen` 14271294Sngien1=`namegen` 15271294Sngie 16271294Sngieexpect 0 mkdir ${n0} 0755 17275504Sngien=`mdconfig -a -n -t malloc -s 1m` || exit 18275504Sngienewfs /dev/md${n} >/dev/null || exit 19275504Sngiemount /dev/md${n} ${n0} || exit 20271294Sngieexpect 0 create ${n0}/${n1} 0644 21271294Sngieexpect 0 chmod ${n0}/${n1} 0640 22271294Sngieexpect 0640 stat ${n0}/${n1} mode 23271294Sngieexpect 0 lchmod ${n0}/${n1} 0530 24271294Sngieexpect 0530 stat ${n0}/${n1} mode 25271294Sngiemount -ur /dev/md${n} 26271294Sngieexpect EROFS chmod ${n0}/${n1} 0600 27271294Sngieexpect EROFS lchmod ${n0}/${n1} 0600 28271294Sngieexpect 0530 stat ${n0}/${n1} mode 29271294Sngiemount -uw /dev/md${n} 30271294Sngieexpect 0 chmod ${n0}/${n1} 0600 31271294Sngieexpect 0600 stat ${n0}/${n1} mode 32271294Sngieexpect 0 lchmod ${n0}/${n1} 0640 33271294Sngieexpect 0640 stat ${n0}/${n1} mode 34271294Sngieexpect 0 unlink ${n0}/${n1} 35271294Sngieumount /dev/md${n} 36275504Sngiemdconfig -d -u ${n} || exit 37271294Sngieexpect 0 rmdir ${n0} 38