mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-08-28 08:35:57 +00:00
feat: vendor permission system source
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Paths that are universally safe and should never trigger external-directory checks.
|
||||
* These are OS device files: read returns EOF or process streams, write discards or goes to process streams.
|
||||
*/
|
||||
export const SAFE_SYSTEM_PATHS: ReadonlySet<string> = new Set([
|
||||
"/dev/null",
|
||||
"/dev/stdin",
|
||||
"/dev/stdout",
|
||||
"/dev/stderr",
|
||||
]);
|
||||
|
||||
/**
|
||||
* Returns true if the given normalized path is a safe OS device file
|
||||
* that should never trigger external-directory checks.
|
||||
*/
|
||||
export function isSafeSystemPath(normalizedPath: string): boolean {
|
||||
return SAFE_SYSTEM_PATHS.has(normalizedPath);
|
||||
}
|
||||
Reference in New Issue
Block a user