skip "isFileSafe" check for plugins' root_actions if the server is running as "root"

improve directory retrieval
This commit is contained in:
lars 2007-01-20 20:57:52 +00:00
parent ab6e34ddf9
commit dcefd224e9
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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