From ff183fc0538ada32e18b0c25ceca737d206d037e Mon Sep 17 00:00:00 2001 From: Vladimir Diaz Date: Mon, 23 Apr 2018 11:04:50 -0400 Subject: [PATCH] Convert any backward slashes from path given by client Signed-off-by: Vladimir Diaz --- tuf/client/updater.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tuf/client/updater.py b/tuf/client/updater.py index 97681a3f..73dd6d08 100755 --- a/tuf/client/updater.py +++ b/tuf/client/updater.py @@ -2629,6 +2629,8 @@ def get_one_valid_targetinfo(self, target_filepath): # Raise 'securesystemslib.exceptions.FormatError' if there is a mismatch. securesystemslib.formats.RELPATH_SCHEMA.check_match(target_filepath) + target_filepath = target_filepath.replace('\\', '/') + if target_filepath.startswith('/'): raise tuf.exceptions.FormatError('The requested target file cannot' ' contain a leading path separator: ' + repr(target_filepath))