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
{{ message }}
Repository navigation
tarfile applies a hard link member's attributes through a symlink extracted in its place #160297
When a hard link member's target is not on disk, tarfile extracts a copy of the member it refers to instead. If that member is a symlink, the copy is a symlink, and _extract_member() then applies the hard link member's owner, mode and mtime with os.chown(), os.chmod() and os.utime(), which follow it. With filter='tar' or filter='fully_trusted', whoever supplies the archive can set the mode and mtime (and, when extracting as root, the owner) of an existing file or directory outside the destination. filter='data' rejects this archive with LinkFallbackError.
This prints 0o755 86400.0. A plain symlink member x -> ../private leaves the directory at 0o700 with its original mtime, and a hard link to a symlink should do the same. The os.chown() part was not run (it needs root). gh-157190 and gh-151558 fixed neighbouring paths in the same fallback.
Activity