1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-02-22 15:15:36 +02:00
Files
coreutils/tests/misc/chcon-fail
2007-09-15 08:40:38 +02:00

29 lines
467 B
Bash
Executable File

#!/bin/sh
# Ensure that chcon fails when it should.
# These tests don't use any actual SE Linux syscalls.
if test "$VERBOSE" = yes; then
set -x
chcon --version
fi
. $srcdir/../lang-default
. $srcdir/../test-lib.sh
fail=0
# neither context nor file
chcon 2> /dev/null && fail=1
# No file
chcon CON 2> /dev/null && fail=1
# No file
touch f
chcon --reference=f 2> /dev/null && fail=1
# No file
chcon -u anyone 2> /dev/null && fail=1
(exit $fail); exit $fail