[Patches] [ python-Patches-1507247 ] tarfile extraction does not honor umask
SourceForge.net
noreply at sourceforge.net
Wed Dec 6 00:40:54 CET 2006
Patches item #1507247, was opened at 2006-06-16 13:11
Message generated for change (Comment added) made by hanwen
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1507247&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Faik Uygur (faik)
Assigned to: Nobody/Anonymous (nobody)
Summary: tarfile extraction does not honor umask
Initial Comment:
If the upperdirs in the member file's pathname does not
exist. tarfile creates those paths with 0777 permission
bits and does not honor umask.
This patch uses umask to set the ti.mode of the created
directory for later usage in chmod.
--- tarfile.py (revision 46993)
+++ tarfile.py (working copy)
@@ -1560,7 +1560,9 @@
ti = TarInfo()
ti.name = upperdirs
ti.type = DIRTYPE
- ti.mode = 0777
+ umask = os.umask(0)
+ ti.mode = 0777 - umask
+ os.umask(umask)
ti.mtime = tarinfo.mtime
ti.uid = tarinfo.uid
ti.gid = tarinfo.gid
----------------------------------------------------------------------
Comment By: Han-Wen Nienhuys (hanwen)
Date: 2006-12-05 23:40
Message:
Logged In: YES
user_id=161998
Originator: NO
Hi,
I can reproduce this problem on python 2.4 , and patch applies to python
2.5 too. Fix looks good to me.
----------------------------------------------------------------------
Comment By: Faik Uygur (faik)
Date: 2006-08-18 10:44
Message:
Logged In: YES
user_id=1541018
Above patch is wrong. The correct one is attached.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1507247&group_id=5470
More information about the Patches
mailing list