| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ab03ab4 commit d872aaf
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'); | |
@@ -66,6 +69,7 @@ if (process.argv[2] === 'wasi-child') { | |||
| 66 | 69 | 'wasi-child', | |
| 67 | 70 | options.test, | |
| 68 | 71 | sandbox, | |
| 72 | + sandboxedTmp, | ||
| 69 | 73 | ], opts); | |
| 70 | 74 | console.log(child.stderr.toString()); | |
| 71 | 75 | assert.strictEqual(child.status, 0); | |
@@ -75,6 +79,7 @@ if (process.argv[2] === 'wasi-child') { | |||
| 75 | 79 | ||
| 76 | 80 | runWASI({ test: 'create_symlink', stdout: 'hello from input.txt' }); | |
| 77 | 81 | runWASI({ test: 'follow_symlink', stdout: 'hello from input.txt' }); | |
| 82 | + runWASI({ test: 'link' }); | ||
| 78 | 83 | runWASI({ test: 'symlink_escape' }); | |
| 79 | 84 | runWASI({ test: 'symlink_loop' }); | |
| 80 | 85 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,7 +78,6 @@ if (process.argv[2] === 'wasi-child') { | |||
| 78 | 78 | runWASI({ test: 'getrusage' }); | |
| 79 | 79 | } | |
| 80 | 80 | runWASI({ test: 'gettimeofday' }); | |
| 81 | - runWASI({ test: 'link' }); | ||
| 82 | 81 | runWASI({ test: 'main_args' }); | |
| 83 | 82 | runWASI({ test: 'notdir' }); | |
| 84 | 83 | runWASI({ test: 'poll' }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments