"Fossies" - the Fresh Open Source Software Archive

Member "lessfs-1.7.0/regression/pjd-fstest-20080816-lessfs/tests/link/07.t" (29 Mar 2008, 970 Bytes) of archive /linux/misc/lessfs-1.7.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 # $FreeBSD: src/tools/regression/fstest/tests/link/07.t,v 1.1 2007/01/17 01:42:09 pjd Exp $
    3 
    4 desc="link returns EACCES when the requested link requires writing in a directory with a mode that denies write permission"
    5 
    6 dir=`dirname $0`
    7 . ${dir}/../misc.sh
    8 
    9 echo "1..17"
   10 
   11 n0=`namegen`
   12 n1=`namegen`
   13 n2=`namegen`
   14 n3=`namegen`
   15 n4=`namegen`
   16 
   17 expect 0 mkdir ${n0} 0755
   18 cdir=`pwd`
   19 cd ${n0}
   20 
   21 expect 0 mkdir ${n1} 0755
   22 expect 0 chown ${n1} 65534 65534
   23 expect 0 mkdir ${n2} 0755
   24 expect 0 chown ${n2} 65534 65534
   25 expect 0 -u 65534 -g 65534 create ${n1}/${n3} 0644
   26 
   27 expect 0 -u 65534 -g 65534 link ${n1}/${n3} ${n2}/${n4}
   28 expect 0 -u 65534 -g 65534 unlink ${n2}/${n4}
   29 
   30 expect 0 chmod ${n2} 0555
   31 expect EACCES -u 65534 -g 65534 link ${n1}/${n3} ${n2}/${n4}
   32 expect 0 chmod ${n1} 0555
   33 expect EACCES -u 65534 -g 65534 link ${n1}/${n3} ${n1}/${n4}
   34 expect 0 chmod ${n1} 0755
   35 
   36 expect 0 unlink ${n1}/${n3}
   37 expect 0 rmdir ${n1}
   38 expect 0 rmdir ${n2}
   39 
   40 cd ${cdir}
   41 expect 0 rmdir ${n0}