]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Ensure that /dev/full is a character device
authorJim Meyering <jim@meyering.net>
Fri, 9 Mar 2001 18:03:22 +0000 (18:03 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 9 Mar 2001 18:03:22 +0000 (18:03 +0000)
(using test -c) as well as being writable, before trying to write to it.
Otherwise, the test could mistakenly append a newline to an existing,
regular, writable, /dev/full file.
Suggested by Ulrich Drepper.

tests/help-version

index a30a309f1ded49586723f7e9dd1bd28ff647bd87..d0ae9a4d64346b468907e2283bc236daf1a011d1 100755 (executable)
@@ -11,7 +11,7 @@ expected_failure_status_sort=2
 
 case "$all_programs" in
   *nohup*)
-    if test -w /dev/full && echo > /dev/full; then
+    if test -w /dev/full && test -c /dev/full && echo > /dev/full; then
       cat 1>&2 <<\EOF
 ************************************************
 WARNING: On this system, the built-in echo function of /bin/sh
@@ -51,7 +51,7 @@ for i in $all_programs; do
   ./$i --version >/dev/null || fail=1
 
   # Make sure they fail upon `disk full' error.
-  if test -w /dev/full; then
+  if test -w /dev/full && test -c /dev/full; then
     ./$i --help >/dev/full 2>/dev/null && fail=1
     ./$i --version >/dev/full 2>/dev/null
     status=$?