| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent c1782ea commit 5696bcf
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,8 @@ if (process.argv[2] === 'wasi-child') { | |||
| 14 | 14 | args: [], | |
| 15 | 15 | env: process.env, | |
| 16 | 16 | preopens: { | |
| 17 | - '/sandbox': process.argv[4] | ||
| 17 | + '/sandbox': process.argv[4], | ||
| 18 | + '/tmp': process.argv[5] | ||
| 18 | 19 | } | |
| 19 | 20 | }); | |
| 20 | 21 | const importObject = { wasi_snapshot_preview1: wasi.wasiImport }; | |
@@ -45,9 +46,11 @@ if (process.argv[2] === 'wasi-child') { | |||
| 45 | 46 | const escapingSymlink = path.join(sandboxedDir, 'outside.txt'); | |
| 46 | 47 | const loopSymlink1 = path.join(sandboxedDir, 'loop1'); | |
| 47 | 48 | const loopSymlink2 = path.join(sandboxedDir, 'loop2'); | |
| 49 | + const sandboxedTmp = path.join(tmpdir.path, 'tmp'); | ||
| 48 | 50 | ||
| 49 | 51 | fs.mkdirSync(sandbox); | |
| 50 | 52 | fs.mkdirSync(sandboxedDir); | |
| 53 | + fs.mkdirSync(sandboxedTmp); | ||
| 51 | 54 | fs.writeFileSync(sandboxedFile, 'hello from input.txt', 'utf8'); | |
| 52 | 55 | fs.writeFileSync(externalFile, 'this should be inaccessible', 'utf8'); | |
| 53 | 56 | fs.symlinkSync(path.join('.', 'input.txt'), sandboxedSymlink, 'file'); | |
@@ -67,6 +70,7 @@ if (process.argv[2] === 'wasi-child') { | |||
| 67 | 70 | 'wasi-child', | |
| 68 | 71 | options.test, | |
| 69 | 72 | sandbox, | |
| 73 | + sandboxedTmp, | ||
| 70 | 74 | ], opts); | |
| 71 | 75 | console.log(child.stderr.toString()); | |
| 72 | 76 | assert.strictEqual(child.status, 0); | |
@@ -76,6 +80,7 @@ if (process.argv[2] === 'wasi-child') { | |||
| 76 | 80 | ||
| 77 | 81 | runWASI({ test: 'create_symlink', stdout: 'hello from input.txt' }); | |
| 78 | 82 | runWASI({ test: 'follow_symlink', stdout: 'hello from input.txt' }); | |
| 83 | + runWASI({ test: 'link' }); | ||
| 79 | 84 | runWASI({ test: 'symlink_escape' }); | |
| 80 | 85 | runWASI({ test: 'symlink_loop' }); | |
| 81 | 86 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,6 @@ if (process.argv[2] === 'wasi-child') { | |||
| 79 | 79 | runWASI({ test: 'getrusage' }); | |
| 80 | 80 | } | |
| 81 | 81 | runWASI({ test: 'gettimeofday' }); | |
| 82 | - runWASI({ test: 'link' }); | ||
| 83 | 82 | runWASI({ test: 'main_args' }); | |
| 84 | 83 | runWASI({ test: 'notdir' }); | |
| 85 | 84 | runWASI({ test: 'poll' }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments