resolve relative paths relative to base_dir in unsafe mode