This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile forgets set sgid when targetpath has it
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.7, Python 3.6, Python 3.5, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Charles Coulombe
Priority: normal Keywords: patch

Created on 2019-09-26 14:12 by Charles Coulombe, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
tarfile_sgid.patch Charles Coulombe, 2019-10-25 13:52
Messages (1)
msg353305 - (view) Author: Charles Coulombe (Charles Coulombe) Date: 2019-09-26 14:12
An archive that does not have sgid that is extracted in a directory with sgid set does not end up having its sgid set since the targetpath is chmod with the mode of the tarinfo. (Lib/tarfile.py#L2277) 

For comparison, an archive extracted with tar has the sgid bit set.

I added a patch as attachment to gather comments before making this PR.
History
Date User Action Args
2022-04-11 14:59:20adminsetgithub: 82467
2019-10-25 13:52:47Charles Coulombesetfiles: + tarfile_sgid.patch
2019-10-25 13:52:25Charles Coulombesetfiles: - tarfile_sgid.patch
2019-09-26 14:12:19Charles Coulombecreate