diff options
author | Laszlo Ersek <lersek@redhat.com> | 2020-12-16 22:10:53 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-12-21 17:16:23 +0000 |
commit | 9307d7c7a4a851615f1c4ac92e59f1ba33a3f626 (patch) | |
tree | c957e87adb2b4ab5f8f2ab1e2f3cb624594b8303 /BaseTools/Source/Python/Common/BuildToolError.py | |
parent | 28092a3938655be5805dd042a5313ec2b948294a (diff) | |
download | edk2-9307d7c7a4a851615f1c4ac92e59f1ba33a3f626.tar.gz edk2-9307d7c7a4a851615f1c4ac92e59f1ba33a3f626.tar.bz2 edk2-9307d7c7a4a851615f1c4ac92e59f1ba33a3f626.zip |
OvmfPkg/VirtioFsDxe: add helper for appending and sanitizing paths
EFI_FILE_PROTOCOL.Open() -- for opening files -- and
EFI_FILE_PROTOCOL.SetInfo() -- for renaming files -- will require us to
append a relative UEFI pathname to an absolute base pathname. In turn,
components of the resultant pathnames will have to be sent to virtiofsd,
which does not consume UEFI-style pathnames.
We're going to maintain the base pathnames in canonical POSIX format:
- absolute (starts with "/"),
- dot (.) and dot-dot (..) components resolved/removed,
- uses forward slashes,
- sequences of slashes collapsed,
- printable ASCII character set,
- CHAR8 encoding,
- no trailing slash except for the root directory itself,
- length at most VIRTIO_FS_MAX_PATHNAME_LENGTH.
Add a helper function that can append a UEFI pathname to such a base
pathname, and produce the result in conformance with the same invariants.
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3097
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20201216211125.19496-17-lersek@redhat.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Diffstat (limited to 'BaseTools/Source/Python/Common/BuildToolError.py')
0 files changed, 0 insertions, 0 deletions