From 22e2d0a41789ba43b1f6278fb897ac1c74606948 Mon Sep 17 00:00:00 2001 From: meejah Date: Thu, 22 Feb 2018 15:32:00 -0700 Subject: [PATCH] re-expand path because user input --- src/allmydata/node.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/allmydata/node.py b/src/allmydata/node.py index a9d0128f6..9010fedcd 100644 --- a/src/allmydata/node.py +++ b/src/allmydata/node.py @@ -346,7 +346,12 @@ class _Config(object): returns an absolute path inside the config directory with any extra args join()-ed """ - return os.path.join(self._basedir, *args) + # note: we re-expand here (_basedir already went through this + # expanduser function) in case the path we're being asked for + # has embedded ".."'s in it + return abspath_expanduser_unicode( + os.path.join(self._basedir, *args) + ) @staticmethod def _contains_unescaped_hash(item):