You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is meant to add a file named \ to the archive. According to the specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT), this should be allowed, and it's certainly allowed by standard implementations of the zip command (that is, touch '\' && zip -r test.zip '\' works as expected and produces an archive containing a single file \).
However, what happens in practice is that this fails with the following error message:
ArchiverError: entry name must be a non-empty string value
In this case, the name is transformed to testing/, which incorrectly results in the creation of a directory instead of a file with the specified contents.
Consider the following code:
This is meant to add a file named
\
to the archive. According to the specification (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT), this should be allowed, and it's certainly allowed by standard implementations of thezip
command (that is,touch '\' && zip -r test.zip '\'
works as expected and produces an archive containing a single file\
).However, what happens in practice is that this fails with the following error message:
This happens because of the following line:
node-archiver/lib/core.js
Line 310 in 2050cfa
Which in turn runs this:
https://github.com/archiverjs/archiver-utils/blob/695387cdc4816a3d19edb6f1d5473e6395479567/index.js#L91-L93
sanitizePath
transforms\
into the empty string.The same underlying problem causes a different issue with the following code:
In this case, the name is transformed to
testing/
, which incorrectly results in the creation of a directory instead of a file with the specified contents.One more example:
This actually creates
testing/foo/bar.txt
, which is not at all what was intended.The text was updated successfully, but these errors were encountered: