uint WindowsDirectoryShareMode { get; }
Source
Gets the Windows sharing policy used while holding an artifact parent directory open.
Opens collector artifacts without following symbolic links or accepting non-regular files.
FileStream OpenRegularFile(string projectOutputDirectory, string rawResultsDirectory, string candidate, Action? beforeWindowsCandidateOpen = null)
Source
Opens candidate for reading and validates the opened object itself.
projectOutputDirectoryThe trusted project output root.rawResultsDirectoryThe unique raw-results directory for this invocation.candidateThe enumerated collector artifact path.beforeWindowsCandidateOpenAn optional test seam invoked after Windows parent handles are held.Every untrusted path component is traversed without following links on Unix. On Windows, the opened handle is rejected when it is a reparse point or non-disk file, and its final path must remain beneath the already-open raw-results directory. Unsupported platforms fail closed.
void EnsureWindowsDirectoryIdentityUnchanged(WindowsDirectoryIdentity expected, WindowsDirectoryIdentity actual)
Source
Rejects a Windows directory that no longer names the same opened file-system object.
expectedThe path and identity captured before opening the artifact.actualThe path and identity captured after opening the artifact.string[] ValidateUnixRelativeArtifactPath(string relativePath)
Source
Splits a Unix artifact path only after proving that it is a relative descent with no navigation components.
Identifies one Windows file-system object independently of its path.
VolumeSerialNumberThe serial number of the volume containing the object.FileIdThe file identifier reported for the opened object.Associates a Windows directory path with the identity of its opened file-system object.
PathThe normalized directory path.IdentityThe identity captured from the opened directory handle.Provides the native file-system primitives shared by secure coverage path traversal.
This type contains only the operating-system boundary. Callers remain responsible for choosing no-follow flags, validating object kinds and identities, and retaining handles for the lifetime of each security-sensitive operation.
int UnixOpen(string path, int flags)
Source
Opens a Unix path with the supplied native flags.
pathThe UTF-8 path to open.flagsThe platform-specific native open flags.A nonnegative file descriptor on success; otherwise -1.
int UnixOpenAt(int directoryDescriptor, string path, int flags)
Source
Opens a Unix path relative to an existing directory descriptor.
directoryDescriptorThe descriptor of the directory from which traversal starts.pathThe UTF-8 relative path to open.flagsThe platform-specific native open flags.A nonnegative file descriptor on success; otherwise -1.
int UnixOpenAt(int directoryDescriptor, string path, int flags, uint mode)
Source
Opens or creates a Unix path relative to an existing directory descriptor.
directoryDescriptorThe descriptor of the directory from which traversal starts.pathThe UTF-8 relative path to open or create.flagsThe platform-specific native open flags.modeThe permissions applied when the flags create a new object.A nonnegative file descriptor on success; otherwise -1.
int UnixFStat(int descriptor, nint buffer)
Source
Reads native metadata for an open Unix descriptor into a caller-owned buffer.
descriptorThe open descriptor to inspect.bufferA caller-owned buffer large enough for the platform's native stat structure.Zero on success; otherwise -1.
int UnixFChmod(int descriptor, uint mode)
Source
Changes the permissions of an open Unix descriptor.
descriptorThe open descriptor whose permissions should be changed.modeThe requested Unix permission bits.Zero on success; otherwise -1.
SafeFileHandle WindowsCreateFile(string fileName, uint desiredAccess, uint shareMode, nint securityAttributes, uint creationDisposition, uint flagsAndAttributes, nint templateFile)
Source
Opens or creates a Windows file-system object without applying managed path traversal.
fileNameThe UTF-16 path to open.desiredAccessThe requested native access mask.shareModeThe native sharing mask retained for the handle lifetime.securityAttributesAn optional native security-attributes pointer.creationDispositionThe native create-or-open disposition.flagsAndAttributesThe native file flags and attributes.templateFileAn optional template-file handle.A handle that is invalid when the native open fails.
bool WindowsGetFileInformationByHandleEx(SafeFileHandle handle, int fileInformationClass, out WindowsFileAttributeTagInformation fileInformation, uint bufferSize)
Source
Reads the attribute and reparse-tag metadata for an open Windows handle.
handleThe open handle to inspect.fileInformationClassThe native information-class identifier.fileInformationReceives the file attributes and reparse tag.bufferSizeThe size of fileInformation in bytes.true on success; otherwise false.
bool WindowsGetFileInformationByHandle(SafeFileHandle handle, out WindowsByHandleFileInformation fileInformation)
Source
Reads stable file-system identity metadata for an open Windows handle.
handleThe open handle to inspect.fileInformationReceives the native identity and size metadata.true on success; otherwise false.
uint WindowsGetFileType(SafeFileHandle handle)
Source
Gets the Windows object type associated with an open handle.
handleThe open handle to classify.The native file-type constant, or zero when the call fails.
uint WindowsGetFinalPathNameByHandle(SafeFileHandle handle, Span<char> path, uint flags)
Source
Resolves the final Windows path for an open handle into the supplied buffer.
handleThe open file-system handle.pathThe destination buffer, including space for the terminator.flagsThe native volume-name formatting flags.The path length excluding the terminator, or the required buffer length when the buffer is too small; zero indicates failure and leaves the native error available to the caller.
Contains Windows file attributes and the reparse tag for an open handle.
Contains stable identity and size metadata for an open Windows handle.
Represents the blittable two-word layout of a native Windows FILETIME.