-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
tarfile.data_filter wrongly rejects some tarballs with symlinks #107845
Copy link
Copy link
Closed
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.10only security fixesonly security fixes3.11only security fixesonly security fixes3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.8 (EOL)end of lifeend of life3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done
My implementation of PEP-706 has a bug: it wrongly determines the target of symlinks, and thus wrongly raises
LinkOutsideDestinationErroron some valid tarballs.I didn't pay enough attention to this quirk of the format (which I'd like to add to TarInfolinkname docs):
So, in a tarball that contains the following, the links point to
dir/target:dir/targetother_dir/symlink->../dir/targetother_dir/hardlink->dir/targetBut
data_filterthinks thatother_dir/symlinkwill point to../dir targetoutside the destination directory.I have a fix but would like to test it more next week, before merging.
Sorry for the extra work this'll cause for a lot of people :(
Linked PRs