[New-bugs-announce] [issue6196] tarfile.extractall(readaccess=True)
Sridhar Ratnakumar
report at bugs.python.org
Thu Jun 4 23:45:52 CEST 2009
New submission from Sridhar Ratnakumar <sridharr at activestate.com>:
If a tarball has a-x perms set on its root directory, one cannot access
its contents.
$ tar zxf generator_tools-0.3.5.tar.gz.
$ ls generator_tools-0.3.5/
ls: cannot access generator_tools-0.3.5/README.txt: Permission denied
...
sridharr at double:/tmp/i$
This is fine for GNU tar (the user can always do a chmod +x later). But
for the tarfile library, it would be better to have a flag such as
readaccess=True that will force ``extractall`` to enforce *minimum*
permissions required for the basic read access. This means, tarfile
would ignore u-x on directories and u-r on files.
The reason I make this feature request (instead of working around the
issue myself in a verbose way) is that the very reason to write a
program to extract tarball (instead of doing it manually) is to automate
it .. which automation is more effective and simple if ``extractall``
had a flag such as readaccess=True.
----------
components: Library (Lib)
messages: 88908
nosy: srid
severity: normal
status: open
title: tarfile.extractall(readaccess=True)
type: feature request
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6196>
_______________________________________
More information about the New-bugs-announce
mailing list