From: Ciaran Gultnieks Date: Sun, 24 Nov 2013 09:47:11 +0000 (+0000) Subject: Make rm work propery with symlinks X-Git-Tag: 0.1~152 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=95495b2818a13a0c8c3f044ee01dd7fe2b3c2fb0;p=fdroidserver.git Make rm work propery with symlinks --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index bd50adb7..90eb2c1a 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -904,11 +904,11 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver= if 'rm' in build: for part in build['rm'].split(';'): dest = os.path.join(build_dir, part.strip()) - rdest = os.path.realpath(dest) - if not rdest.startswith(os.path.realpath(build_dir)): - raise BuildException("rm for {0} is outside build root {1}".format( - os.path.realpath(build_dir),os.path.realpath(dest))) - if rdest == os.path.realpath(build_dir): + rdest = os.path.abspath(dest) + if not rdest.startswith(os.path.abspath(build_dir)): + raise BuildException("rm for {1} is outside build root {0}".format( + os.path.abspath(build_dir),os.path.abspath(dest))) + if rdest == os.path.abspath(build_dir): raise BuildException("rm removes whole build directory") if os.path.exists(rdest): subprocess.call('rm -rf ' + rdest, shell=True)