📄 not-owner
字号:
#!/bin/sh# Make sure that touch gives reasonable diagnostics when applied# to an unwritable directory owned by some other user.if test "$VERBOSE" = yes; then set -x touch --versionfi. $srcdir/../envvar-check. $srcdir/../lang-defaultPRIV_CHECK_ARG=require-non-root . $srcdir/../priv-checkpwd=`pwd`tmp=fail-diag.$$trap 'status=$?; cd $pwd; rm -rf $tmp && exit $status' 0trap '(exit $?); exit' 1 2 13 15framework_failure=0mkdir $tmp || framework_failure=1cd $tmp || framework_failure=1if test $framework_failure = 1; then echo 'failure in testing framework' 1>&2 (exit 1); exitfifail=0# Before fileutils-4.1, we'd get the following misleading# diagnostic instead of `...: Permission denied'.# touch: creating `/': Is a directorytouch / > out 2>&1 && fail=1# On SunOS4, EPERM is `Not owner'.# On some *BSD systems it's `Operation not permitted'.for msg in 'Not owner' 'Operation not permitted' 'Permission denied'; do cat > exp <<EOFtouch: setting times of \`/': $msgEOF cmp out exp > /dev/null 2>&1 && { match=1; break; }donetest "$match" = 1 || fail=1test $fail = 1 && diff out exp 2> /dev/null(exit $fail); exit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -