Patches item #1507247, was opened at 2006-06-16 15:11
Message generated for change (Comment added) made by faik
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
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: Faik Uygur (faik)
Date: 2006-08-18 12: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
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches

Reply via email to