From: Bryn Dole Date: Fri, 22 Jun 2018 04:31:11 +0000 (-0700) Subject: Fix for issue #914. incorrect path manipulation when using symlink for dropbox and... X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=e9041db457a3555f51bc10b077b20218745cd53b;p=motioneye-debian Fix for issue #914. incorrect path manipulation when using symlink for dropbox and other upload services. use os.path.realpath on rel_filename before truncating. --- diff --git a/motioneye/uploadservices.py b/motioneye/uploadservices.py index fd93d14..c8cf9e7 100644 --- a/motioneye/uploadservices.py +++ b/motioneye/uploadservices.py @@ -54,7 +54,8 @@ class UploadService(object): def upload_file(self, target_dir, filename): if target_dir: target_dir = os.path.realpath(target_dir) - rel_filename = filename[len(target_dir):] + rel_filename = os.path.realpath(filename) + rel_filename = rel_filename[len(target_dir):] while rel_filename.startswith('/'): rel_filename = rel_filename[1:]