just-bash 2.10.2 → 2.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/chunks/{chunk-FEBB4TFH.js → chunk-4U7XM2O3.js} +6 -6
- package/dist/bin/{shell/chunks/flag-coverage-SFRIE2LL.js → chunks/flag-coverage-WM63KT7D.js} +1 -1
- package/dist/bin/{shell/chunks/sed-WNL6TIIN.js → chunks/sed-PHQQJ4SI.js} +1 -1
- package/dist/bin/just-bash.js +205 -205
- package/dist/bin/shell/chunks/{chunk-FEBB4TFH.js → chunk-4U7XM2O3.js} +6 -6
- package/dist/bin/{chunks/flag-coverage-SFRIE2LL.js → shell/chunks/flag-coverage-WM63KT7D.js} +1 -1
- package/dist/bin/{chunks/sed-WNL6TIIN.js → shell/chunks/sed-PHQQJ4SI.js} +1 -1
- package/dist/bin/shell/shell.js +216 -216
- package/dist/bundle/browser.js +24 -24
- package/dist/bundle/chunks/{chunk-WACZHM4L.js → chunk-MZLOTDD7.js} +6 -6
- package/dist/bundle/chunks/{flag-coverage-MX32DFGQ.js → flag-coverage-H2IQM6DS.js} +1 -1
- package/dist/bundle/chunks/{sed-RXIECPPB.js → sed-7HX4RAZG.js} +1 -1
- package/dist/bundle/index.js +213 -213
- package/dist/fs/overlay-fs/overlay-fs.d.ts +13 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +12 -0
- package/package.json +1 -1
|
@@ -32,12 +32,19 @@ export interface OverlayFsOptions {
|
|
|
32
32
|
}
|
|
33
33
|
export declare class OverlayFs implements IFileSystem {
|
|
34
34
|
private readonly root;
|
|
35
|
+
private readonly canonicalRoot;
|
|
35
36
|
private readonly mountPoint;
|
|
36
37
|
private readonly readOnly;
|
|
37
38
|
private readonly maxFileReadSize;
|
|
38
39
|
private readonly memory;
|
|
39
40
|
private readonly deleted;
|
|
40
41
|
constructor(options: OverlayFsOptions);
|
|
42
|
+
/**
|
|
43
|
+
* Validate that a real filesystem path stays within the sandbox root
|
|
44
|
+
* after resolving all OS-level symlinks (including in parent components).
|
|
45
|
+
* Returns false if the path escapes the sandbox.
|
|
46
|
+
*/
|
|
47
|
+
private validateRealPath;
|
|
41
48
|
/**
|
|
42
49
|
* Throws an error if the filesystem is in read-only mode.
|
|
43
50
|
*/
|
|
@@ -87,6 +94,12 @@ export declare class OverlayFs implements IFileSystem {
|
|
|
87
94
|
stat(path: string, seen?: Set<string>): Promise<FsStat>;
|
|
88
95
|
lstat(path: string): Promise<FsStat>;
|
|
89
96
|
private resolveSymlink;
|
|
97
|
+
/**
|
|
98
|
+
* Convert a real-fs symlink target to a virtual target suitable for resolveSymlink.
|
|
99
|
+
* Handles absolute real-fs paths that point within the root by converting them
|
|
100
|
+
* to virtual paths relative to the mount point.
|
|
101
|
+
*/
|
|
102
|
+
private realTargetToVirtual;
|
|
90
103
|
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
91
104
|
/**
|
|
92
105
|
* Core readdir implementation that returns entries with file types.
|
|
@@ -24,8 +24,20 @@ export interface ReadWriteFsOptions {
|
|
|
24
24
|
}
|
|
25
25
|
export declare class ReadWriteFs implements IFileSystem {
|
|
26
26
|
private readonly root;
|
|
27
|
+
private readonly canonicalRoot;
|
|
27
28
|
private readonly maxFileReadSize;
|
|
28
29
|
constructor(options: ReadWriteFsOptions);
|
|
30
|
+
/**
|
|
31
|
+
* Validate that a resolved real path stays within the sandbox root.
|
|
32
|
+
* Resolves all symlinks to detect escape attempts via OS-level symlinks.
|
|
33
|
+
* Throws EACCES if the path escapes the root.
|
|
34
|
+
*/
|
|
35
|
+
private resolveAndValidate;
|
|
36
|
+
/**
|
|
37
|
+
* Validate the parent directory of a path (for operations like lstat/readlink
|
|
38
|
+
* that should not follow the final component's symlink).
|
|
39
|
+
*/
|
|
40
|
+
private validateParent;
|
|
29
41
|
/**
|
|
30
42
|
* Convert a virtual path to a real filesystem path.
|
|
31
43
|
*/
|