diff options
Diffstat (limited to 'tests/chown.test')
-rwxr-xr-x | tests/chown.test | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/chown.test b/tests/chown.test index 20be541a..f79d5c1a 100755 --- a/tests/chown.test +++ b/tests/chown.test @@ -9,16 +9,13 @@ then exit fi -if [ -f /etc/group ]; then - # We chown between user "root" and the last user in /etc/passwd, - # and group "root" and the last group in /etc/group. - USR="$(sed -n '$s/:.*//p' /etc/passwd)" - GRP="$(sed -n '$s/:.*//p' /etc/group)" -else - # Or we assume we're on Android... - USR="shell" - GRP="daemon" -fi +# We chown between user "root" and the last user in /etc/passwd, +# and group "root" and the last group in /etc/group. +USR="$(sed -n '$s/:.*//p' /etc/passwd)" +GRP="$(sed -n '$s/:.*//p' /etc/group)" +# Or if that fails, we assume we're on Android... +: "${USR:=shell}" +: "${GRP:=daemon}" # Set up a little testing hierarchy |