Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

require target_exe to be a canonicalized relative path #613

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/api-service/__app__/onefuzzlib/tasks/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -102,6 +104,12 @@ def check_target_exe(config: TaskConfig, definition: TaskDefinition) -> None:

return

if (
bmc-msft marked this conversation as resolved.
Show resolved Hide resolved
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`" % (
Expand Down