Issue 9065: tarfile: default root:root ownership is incorrect. (original) (raw)

Issue9065

Created on 2010-06-23 22:27 by jsbronder, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
python-2.7-tarfile-uid-gid.patch jsbronder,2010-06-23 22:27 review
Messages (2)
msg108493 - (view) Author: Justin Bronder (jsbronder) * Date: 2010-06-23 22:27
According to the tar spec [1], uname/gname should only be filled when they have successfully been resolved from the uid/gid. The tarfile module incorrectly defaults to root:root in this case. A patch against svn trunk r82183 is included. All tarfile unit tests still pass with this patch. I did not include a new unit test as chown() is required. Example using tarfile: $ ls -l tarfile_user -rw-r--r-- 1 65533 jbronder 0 2010-06-23 17:44 tarfile_user $ python -c "import tarfile;a = tarfile.open('bleh.tar', 'w:');a.add('tarfile_user');a.list()" -rw-r--r-- root/jbronder 0 2010-06-23 17:44:55 tarfile_user Example using GNU tarball: $ tar -cf bleh.tar tarfile_user $ python -c "import tarfile;a = tarfile.open('bleh.tar').list()" -rw-r--r-- 65533/jbronder 0 2010-06-23 17:44:55 tarfile_user 1. http://www.gnu.org/software/tar/manual/tar.html#SEC170
msg117960 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2010-10-04 15:39
Fixed in r85211 (py3k), r85212 (release31-maint), r85213 (release27-maint). Thank you for the report.
History
Date User Action Args
2022-04-11 14:57:02 admin set github: 53311
2010-10-04 15:39:29 lars.gustaebel set status: open -> closedtype: behaviormessages: + resolution: acceptedstage: resolved
2010-08-04 22:16:23 terry.reedy set versions: + Python 3.1, Python 3.2, - Python 2.6, Python 2.5
2010-06-24 07:19:31 lars.gustaebel set assignee: lars.gustaebelnosy: + lars.gustaebel
2010-06-23 22:31:42 jsbronder set components: + Library (Lib)versions: + Python 2.6
2010-06-23 22:27:35 jsbronder create