diff options
author | Jim Meyering <meyering@redhat.com> | 2008-03-28 22:37:19 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-03-28 23:03:27 +0100 |
commit | eb8fa94f2cf030d625c12ad68bb8883de204c196 (patch) | |
tree | 8daec3befeac6fdb67abc97c66367f6cc9458dfe /tests | |
parent | cdb16829a668fae0aa5e4e292364fc1fbd009ba8 (diff) | |
download | coreutils-eb8fa94f2cf030d625c12ad68bb8883de204c196.tar.xz |
mknod, mkfifo: don't segfault when diagnosing invalid SELinux context
Identical to the bug fixed by 72d052896a9092b811961a8f3e6ca5d151a59be5.
* src/mkfifo.c (main): Use "scontext", not NULL optarg in diagnostic.
* src/mknod.c (main): Likewise.
Reported by Cristian Cadar, Daniel Dunbar and Dawson Engler.
* tests/mkdir/selinux: Test for the above fixes.
* NEWS: Mention the fixes.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mkdir/selinux | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/mkdir/selinux b/tests/mkdir/selinux index 9bfd0909d..15651ad30 100755 --- a/tests/mkdir/selinux +++ b/tests/mkdir/selinux @@ -19,6 +19,8 @@ if test "$VERBOSE" = yes; then set -x mkdir --version + mkfifo --version + mknod --version fi . $srcdir/../envvar-check @@ -32,7 +34,20 @@ mkdir -Z $c dir-arg 2> out && fail=1 cat <<EOF > exp || fail=1 mkdir: failed to set default file creation context to \`$c': Invalid argument EOF +compare out exp || fail=1 + +# Until coreutils-6.10.150, mknod and mkfifo had the same problem: + +mknod -Z $c b p 2> out && fail=1 +cat <<EOF > exp || fail=1 +mknod: failed to set default file creation context to \`$c': Invalid argument +EOF +compare out exp || fail=1 +mkfifo -Z $c f 2> out && fail=1 +cat <<EOF > exp || fail=1 +mkfifo: failed to set default file creation context to \`$c': Invalid argument +EOF compare out exp || fail=1 (exit $fail); exit $fail |