2 # make sure mkdir's -p options works properly
4 if test "$VERBOSE" = yes; then
11 trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0
12 trap '(exit $?); exit' 1 2 13 15
16 # Record absolute path of srcdir.
17 cd $srcdir || framework_failure
=1
20 cd $pwd || framework_failure
=1
21 mkdir
$tmp || framework_failure
=1
22 cd $tmp || framework_failure
=1
23 mkdir
-m 700 e-dir || framework_failure
=1
25 if test $framework_failure = 1; then
26 echo 'failure in testing framework'
30 .
$abs_srcdir/..
/setgid-check
34 # Make sure `mkdir -p existing-dir' succeeds
35 # and that `mkdir existing-dir' fails.
36 mkdir
-p e-dir || fail
=1
37 mkdir e-dir
> /dev
/null
2>&1 && fail
=1
39 # Create an existing directory.
42 mode_arg
=`$abs_srcdir/../rwx-to-mode $mode_str`
43 mkdir
-m $mode_arg a || fail
=1
45 # this `mkdir -p ...' shouldn't change perms of existing dir `a'.
47 d_mode_arg
=`$abs_srcdir/../rwx-to-mode $d_mode_str`
48 mkdir
-p -m $d_mode_arg a
/b
/c
/d
50 # Make sure the permissions of `a' haven't been changed.
51 p
=`ls -ld a|sed 's/ .*//'`; case $p in $mode_str);; *) fail
=1;; esac
52 # `b's and `c's should reflect the umask
53 p
=`ls -ld a/b|sed 's/ .*//'`; case $p in drwx------
);; *) fail
=1;; esac
54 p
=`ls -ld a/b/c|sed 's/ .*//'`; case $p in drwx------
);; *) fail
=1;; esac
56 # `d's perms are determined by the -m argument.
57 p
=`ls -ld a/b/c/d|sed 's/ .*//'`; case $p in $d_mode_str);; *) fail
=1;; esac