| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e9276ba commit 4adea6c
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,7 +109,6 @@ const { | |||
| 109 | 109 | getValidatedPath, | |
| 110 | 110 | getValidMode, | |
| 111 | 111 | handleErrorFromBinding, | |
| 112 | - possiblyTransformPath, | ||
| 113 | 112 | preprocessSymlinkDestination, | |
| 114 | 113 | Stats, | |
| 115 | 114 | getStatFsFromBinding, | |
@@ -2451,7 +2450,7 @@ function watch(filename, options, listener) { | |||
| 2451 | 2450 | ||
| 2452 | 2451 | let watcher; | |
| 2453 | 2452 | const watchers = require('internal/fs/watchers'); | |
| 2454 | - const path = possiblyTransformPath(filename); | ||
| 2453 | + const path = getValidatedPath(filename); | ||
| 2455 | 2454 | // TODO(anonrig): Remove non-native watcher when/if libuv supports recursive. | |
| 2456 | 2455 | // As of November 2022, libuv does not support recursive file watch on all platforms, | |
| 2457 | 2456 | // e.g. Linux due to the limitations of inotify. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -265,6 +265,13 @@ const regularFile = __filename; | |||
| 265 | 265 | permission: 'FileSystemRead', | |
| 266 | 266 | resource: path.toNamespacedPath(blockedFile), | |
| 267 | 267 | })); | |
| 268 | + assert.throws(() => { | ||
| 269 | + fs.watch(blockedFileURL, () => {}); | ||
| 270 | + }, common.expectsError({ | ||
| 271 | + code: 'ERR_ACCESS_DENIED', | ||
| 272 | + permission: 'FileSystemRead', | ||
| 273 | + resource: path.toNamespacedPath(blockedFile), | ||
| 274 | + })); | ||
| 268 | 275 | ||
| 269 | 276 | // doesNotThrow | |
| 270 | 277 | fs.readdir(allowedFolder, (err) => { | |
@@ -353,4 +360,4 @@ const regularFile = __filename; | |||
| 353 | 360 | permission: 'FileSystemRead', | |
| 354 | 361 | resource: path.toNamespacedPath(blockedFile), | |
| 355 | 362 | })); | |
| 356 | - } | ||
| 363 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments