finally make it work
authorJim Meyering <jim@meyering.net>
Mon, 6 Aug 2001 09:50:05 +0000 (09:50 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 6 Aug 2001 09:50:05 +0000 (09:50 +0000)
tests/priv-check

index 786a4a5913f3a26640d3e17d8489a7d528e4620e..4b95f860fffcf6c20389611484a5805267893911 100644 (file)
@@ -12,7 +12,17 @@ priv_check_temp=priv-check.$$
 touch $priv_check_temp || framework_failure=1
 chmod a-w $priv_check_temp || framework_failure=1
 
-(echo foo >> $priv_check_temp) >/dev/null 2>&1 || {
+(echo foo >> $priv_check_temp) >/dev/null 2>&1
+overwrite_status=$?
+give_msg=no
+case $1:$overwrite_status in
+  require-root:0) ;;
+  require-root:*) give_msg=yes ;;
+  require-non-root:0) give_msg=yes ;;
+  require-non-root:*) ;;
+esac
+
+test $give_msg = yes && {
   cat <<EOF
 ***************************
 NOTICE: