-
Notifications
You must be signed in to change notification settings - Fork 225
Comparing changes
Open a pull request
base repository: isaacs/node-tar
base: v4.4.13
head repository: isaacs/node-tar
compare: v4.4.16
- 20 commits
- 29 files changed
- 1 contributor
Commits on Jul 23, 2021
-
Configuration menu - View commit details
-
Copy full SHA for efc6bb0 - Browse repository at this point
Copy the full SHA efc6bb0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d28013 - Browse repository at this point
Copy the full SHA 6d28013View commit details -
Configuration menu - View commit details
-
Copy full SHA for df3aa4d - Browse repository at this point
Copy the full SHA df3aa4dView commit details
Commits on Jul 26, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 46fe350 - Browse repository at this point
Copy the full SHA 46fe350View commit details -
Configuration menu - View commit details
-
Copy full SHA for 843c897 - Browse repository at this point
Copy the full SHA 843c897View commit details
Commits on Aug 9, 2021
-
This is going to be used to avoid harmful race conditions in parallel extraction operations. For example, a Link to a/b requires that the File at a/b is present. But, if they are run in parallel, then the File might not be written before the Link tries to create, and it'll fail with ENOENT. This gets worse if there's a Directory at a/b/c that unlinks the File so that it can create a dir.
Configuration menu - View commit details
-
Copy full SHA for f0fe3aa - Browse repository at this point
Copy the full SHA f0fe3aaView commit details -
Address unpack race conditions using path reservations
This addresses a race condition where one archive entry depends on an earlier archive entry completing its unpack operation. For example, a File entry followed by a Link to that file would fail if the File was not written before the link() call was attempted, raising an ENOENT. Or, a File entry at a/b could be clobbered mid-write by an entry at a/b/c. This was never a problem for npm packages, because those tarballs are created as a point-in-time snapshot of the package file tree. Indeed, even in the generic case, it's a bit of an edge case. However, this race condition led to some flaky tests, and could certainly be a problem in general tar archive usage, especially if someone were to use tar.update() often to append entries to an archive. Address unpack race conditions using path reservations This addresses a race condition where one archive entry depends on an earlier archive entry completing its unpack operation. For example, a File entry followed by a Link to that file would fail if the File was not written before the link() call was attempted, raising an ENOENT. Or, a File entry at a/b could be clobbered mid-write by an entry at a/b/c. This was never a problem for npm packages, because those tarballs are created as a point-in-time snapshot of the package file tree. Indeed, even in the generic case, it's a bit of an edge case. However, this race condition led to some flaky tests, and could certainly be a problem in general tar archive usage, especially if someone were to use tar.update() often to append entries to an archive.
Configuration menu - View commit details
-
Copy full SHA for b2a97e1 - Browse repository at this point
Copy the full SHA b2a97e1View commit details -
unpack: keep path reservations longer
This avoids races when entries are zero-length, and emit end() before the fs object is fully finished and closed.
Configuration menu - View commit details
-
Copy full SHA for ea6f254 - Browse repository at this point
Copy the full SHA ea6f254View commit details -
Configuration menu - View commit details
-
Copy full SHA for d688cad - Browse repository at this point
Copy the full SHA d688cadView commit details -
Avoid an unlikely but theoretically possible redos
When stripping the trailing slash from `files` arguments, we were using `f.replace(/\/+$/, '')`, which can get exponentially slow when `f` contains many `/` characters. Tested a few variants and found one that's faster than the regexp replacement for short strings, long strings, and long strings containing many instances of repeated `/` characters. This is "unlikely but theoretically possible" because it requires that the user is passing untrusted input into the `tar.extract()` or `tar.list()` array of entries to parse/extract, which would be quite unusual.
Configuration menu - View commit details
-
Copy full SHA for adf3511 - Browse repository at this point
Copy the full SHA adf3511View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0dcc5b2 - Browse repository at this point
Copy the full SHA 0dcc5b2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83bb22c - Browse repository at this point
Copy the full SHA 83bb22cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b2acc5 - Browse repository at this point
Copy the full SHA 7b2acc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd2a38d - Browse repository at this point
Copy the full SHA fd2a38dView commit details -
fix: properly prefix hard links
This moves all the prefix-handling logic into the WriteEntry classes, where it belongs. Fix: #284
Configuration menu - View commit details
-
Copy full SHA for e29a665 - Browse repository at this point
Copy the full SHA e29a665View commit details -
fix: normalize paths on Windows systems
This change uses / as the One True Path Separator, as the gods of POSIX intended in their divine wisdom. On windows, \ characters are converted to /, everywhere and in depth. However, on posix systems, \ is a valid filename character, and is not treated specially. So, instead of splitting on `/[/\\]/`, we can now just split on `'/'` to get a set of path parts. This does mean that archives with entries containing \ will extract differently on Windows systems than on correct systems. However, this is also the behavior of both bsdtar and gnutar, so it seems appropriate to follow suit. Additionally, dirCache pruning is now done case-insensitively. On case-sensitive systems, this potentially results in a few extra lstat calls. However, on case-insensitive systems, it prevents incorrect cache hits.
Configuration menu - View commit details
-
Copy full SHA for 3f2e2da - Browse repository at this point
Copy the full SHA 3f2e2daView commit details -
fix: refactoring to pass tests on Windows
This is a larger refactoring than I tend to prefer to do in a single commit, but here goes. - The path normalization of \ to / is made more comprehensive. - Checking to ensure we aren't overwriting the cwd is done earlier in the unpack process, and more thoroughly, so there is less need for repetitive checks later. - The cwd is checked at the start in our recursive mkdir, saving an extra fs.mkdir call which would almost always result in an EEXIST. - Many edge cases resulting in dangling file descriptors were found and addressed. (Much as I complain about Windows stubbornly refusing to delete files currently open, it did come in handy here.) - The Unpack[MAKEFS] methods are refactored for readability, and no longer rely on fall-through behavior which made the sync and async versions slightly different in some edge cases. - Many of the tests were refactored to use async rimraf (the better to avoid Windows problems) and more modern tap affordances. Note: coverage on Windows is not 100%, due to skipping many tests that use symbolic links. Given the value of having those code paths covered, I believe that adding istanbul hints to skip coverage of those portions of the code would be a bad idea. And given the complexity and hazards involved in mocking that much of the filesystem implementation, it's probably best to just let Windows not have 100% coverage.
Configuration menu - View commit details
-
Copy full SHA for ce5148e - Browse repository at this point
Copy the full SHA ce5148eView commit details -
fix: refactoring to pass tests on Windows
This is a larger refactoring than I tend to prefer to do in a single commit, but here goes. - The path normalization of \ to / is made more comprehensive. - Checking to ensure we aren't overwriting the cwd is done earlier in the unpack process, and more thoroughly, so there is less need for repetitive checks later. - The cwd is checked at the start in our recursive mkdir, saving an extra fs.mkdir call which would almost always result in an EEXIST. - Many edge cases resulting in dangling file descriptors were found and addressed. (Much as I complain about Windows stubbornly refusing to delete files currently open, it did come in handy here.) - The Unpack[MAKEFS] methods are refactored for readability, and no longer rely on fall-through behavior which made the sync and async versions slightly different in some edge cases. - Many of the tests were refactored to use async rimraf (the better to avoid Windows problems) and more modern tap affordances. Note: coverage on Windows is not 100%, due to skipping many tests that use symbolic links. Given the value of having those code paths covered, I believe that adding istanbul hints to skip coverage of those portions of the code would be a bad idea. And given the complexity and hazards involved in mocking that much of the filesystem implementation, it's probably best to just let Windows not have 100% coverage.
Configuration menu - View commit details
-
Copy full SHA for 166cfc0 - Browse repository at this point
Copy the full SHA 166cfc0View commit details -
tests: run (and pass) on windows
Threw a kludge in there to run tap with lower coverage reqs on Windows.
Configuration menu - View commit details
-
Copy full SHA for 53cea6e - Browse repository at this point
Copy the full SHA 53cea6eView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd6accb - Browse repository at this point
Copy the full SHA fd6accbView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v4.4.13...v4.4.16