| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ if (isMainThread) { | |||
| 68 | 68 | ||
| 69 | 69 | // Errors from cleanup are thrown | |
| 70 | 70 | // It is difficult to arrange for rmdir to fail on windows | |
| 71 | - if (!common.isWindows) { | ||
| 71 | + if (!common.isWindows && process.getuid() !== 0) { | ||
| 72 | 72 | const base = fs.mkdtempDisposableSync(tmpdir.resolve('foo.')); | |
| 73 | 73 | ||
| 74 | 74 | // On Unix we can prevent removal by making the parent directory read-only | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,7 +68,7 @@ async function chdirDoesNotAffectRemoval() { | |||
| 68 | 68 | ||
| 69 | 69 | async function errorsAreReThrown() { | |
| 70 | 70 | // It is difficult to arrange for rmdir to fail on windows | |
| 71 | - if (common.isWindows) return; | ||
| 71 | + if (common.isWindows || process.getuid() === 0) return; | ||
| 72 | 72 | const base = await fsPromises.mkdtempDisposable(tmpdir.resolve('foo.')); | |
| 73 | 73 | ||
| 74 | 74 | // On Unix we can prevent removal by making the parent directory read-only | |
| Back | FazBrowse Home | New Git URL |
0 commit comments