mirror of
https://github.com/microsoft/onefuzz.git
synced 2025-06-10 09:11:36 +00:00
require target_exe to be a canonicalized relative path (#613)
This commit is contained in:
parent
4489036d9f
commit
04fc41597e
@ -4,7 +4,9 @@
|
||||
# Licensed under the MIT License.
|
||||
|
||||
import logging
|
||||
import ntpath
|
||||
import os
|
||||
import posixpath
|
||||
from typing import Dict, List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
@ -102,6 +104,16 @@ def check_target_exe(config: TaskConfig, definition: TaskDefinition) -> None:
|
||||
|
||||
return
|
||||
|
||||
# Azure Blob Store uses virtualized directory structures. As such, we need
|
||||
# the paths to already be canonicalized. As an example, accessing the blob
|
||||
# store path "./foo" generates an exception, but "foo" and "foo/bar" do
|
||||
# not.
|
||||
if (
|
||||
posixpath.relpath(config.task.target_exe) != config.task.target_exe
|
||||
or ntpath.relpath(config.task.target_exe) != config.task.target_exe
|
||||
):
|
||||
raise TaskConfigError("target_exe must be a canonicalized relative path")
|
||||
|
||||
container = [x for x in config.containers if x.type == ContainerType.setup][0]
|
||||
if not blob_exists(container.name, config.task.target_exe, StorageType.corpus):
|
||||
err = "target_exe `%s` does not exist in the setup container `%s`" % (
|
||||
|
Loading…
x
Reference in New Issue
Block a user