The main script is setting PATH to use id executable from rather
strange directory. That allowed checks to run without root
privilege. This change will make detection whether test run is
been requested more universal, and to work without super setting
id command.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
RWMJ:
- Use -ne instead of != to compare integers.
15 files changed:
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
+++ /dev/null
-#!/bin/sh -
-echo 0
# Check we're running as root.
-uid=`id -u`
-if [ "$uid" != 0 ]; then
+if [ "x$root" = "x" ] && [ "$EUID" -ne 0 ]; then
fail "this script must be run as root"
fi