fixed remove multiple leading slashes

This commit is contained in:
fbuescher
2025-06-11 09:27:59 +02:00
committed by Andrew Tridgell
parent a4b926dcdc
commit d4c4f6754e

View File

@@ -301,6 +301,7 @@ def validated_arg(opt, arg, typ=3, wild=False):
if arg.startswith('./'):
arg = arg[1:]
arg = arg.replace('//', '/')
arg = arg.lstrip('/')
if args.dir != '/':
if HAS_DOT_DOT_RE.search(arg):
die("do not use .. in", opt, "(anchor the path at the root of your restricted dir)")