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
As of Go1.5, I don't see any logic in the Reader that explicitly forbids "/" path. In fact, it seems that the Reader does properly read back "/". See playground
The "standards" doesn't explicitly reject "/". Personally, I think that tar should not forbid any paths. If "/" is rejected, should we also reject ""? What about absolute paths? As it is, any proper user of tar should be sanitizing the paths read out anyways.
Furthermore, I can imagine a possible use case of "/" where it is encoded into an archive to preserve uid, gid, or something similar.
Closing this. Although discouraged (and the tar utilities will warn), it is possible to have a folder named "/" and to have owner and permission bits set in the tar file and expect the tar utility to set the root directory to those values. I don't think we should forbid that behavior.
The archive/tar Writer permits adding a "/" FileHeader which is then rejected by the Reader in the same package. (and the Linux tar warns about it)
We should probably reject that name and other bogus names in WriteHeader.
The text was updated successfully, but these errors were encountered: