From dcefd224e97f36b5f202b6e6d928e136f8da89ac Mon Sep 17 00:00:00 2001 From: lars Date: Sat, 20 Jan 2007 20:57:52 +0000 Subject: [PATCH] skip "isFileSafe" check for plugins' root_actions if the server is running as "root" improve directory retrieval --- bin/CryptoBoxRootActions | 5 +++++ bin/uml-setup.sh | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) 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