diff --git a/bin/CryptoBoxRootActions b/bin/CryptoBoxRootActions index aa6d929..a8d11a5 100755 --- a/bin/CryptoBoxRootActions +++ b/bin/CryptoBoxRootActions @@ -61,6 +61,11 @@ def checkIfFileIsSafe(fname): ## the override setting may be turned off temporarily to allow unittests if OVERRIDE_FILECHECK: return True + ## if the real user id is 0 (root), then we do not have to check this, + ## as root would be allowed to do this anyway + ## this eases testing with a not-installed working copy in a uml environment + if os.getuid() == 0: + return True props = os.stat(fname) ## check if it is owned by non-root if props.st_uid != 0: return False diff --git a/bin/uml-setup.sh b/bin/uml-setup.sh index c011d72..461f178 100755 --- a/bin/uml-setup.sh +++ b/bin/uml-setup.sh @@ -1,6 +1,7 @@ #!/bin/sh -PROJ_DIR=$($(dirname $0)/..; pwd) +PROJ_DIR=$(dirname "$0")/.. +PROJ_DIR=$(cd "$PROJ_DIR"; pwd) ROOT_IMG=$PROJ_DIR/bin/cryptobox.img TEST_IMG=$PROJ_DIR/bin/test.img TEST_SIZE=128