[Trac] Re: [trac-hacks] zip download permissions

2009-03-25 Thread Noah Kantrowitz

We have yet to be able to track down the cause of this. There is a  
metadata field in the zip file header that we are setting for all  
files, but certain zip programs seem to ignore this and probably use  
some other field which we don't set (and so is 0). If you want to do  
an unzip, set perms, rezip and then try to compare the header data on  
both files it would surely help track down what we need to set to make  
them work.

--Noah

On Mar 24, 2009, at 2:09 AM, jh...@gmx.de wrote:


 Hi,

 as of new downloading plugins from trac-hacks.org invariably results
 in zip archives with unusable permissions for me. E.g.

 $ ls -l /tmp/autocompleteusersplugin/0.11/
 total 1
 drwxr-xr-x 3 pytaf pytaf  96 2009-03-24 09:38 autocompleteusers/
 -- 1 pytaf pytaf 667 2008-12-22 17:40 setup.py

 This behaviour started some time ago, I did not experience such
 problems before. Maybe when trac-hacks moved to the new server?

 I also filed a ticket in the trac-hacks bug tracker:
 http://trac-hacks.org/ticket/4724

 Anyone else having such problems, or is there some evil firewall or
 whatnot hackery in place that mysteriously strips down permissions?
 But I don't see such problems when downloading stuff from pypi...

 Holger

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Trac 
Users group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---



[Trac] Re: [trac-hacks] zip download permissions

2009-03-25 Thread jh...@gmx.de

Hi,

On 25 Mrz., 07:54, Noah Kantrowitz n...@coderanger.net wrote:
 We have yet to be able to track down the cause of this. There is a  
 metadata field in the zip file header that we are setting for all  
 files, but certain zip programs seem to ignore this and probably use  
 some other field which we don't set (and so is 0). If you want to do  
 an unzip, set perms, rezip and then try to compare the header data on  
 both files it would surely help track down what we need to set to make  
 them work.

Downloaded, modified the permissions  rezipped the includemacro, as
an example.
Unfortunately, I have no idea at all about zip file format(s) or how
to output the header.

That said, playing with python zipinfo I suspect the information held
in external_attr is the villain;
it is always 0 in the downloaded archive but has a value in the re-
zipped one - whatever the value
means...

$ python2.4 -i -c 'import zipfile; z_downloaded = zipfile.ZipFile
(includemacro-r5399.zip); z_rezipped = zipfile.ZipFile
(includemacro.zip)'
 for name in z_downloaded.namelist():
... print '\n', name
... print *** downloaded, pformat(z_downloaded.getinfo
(name).__dict__)
... print +++  re-zipped, pformat(z_rezipped.getinfo
(name).__dict__)
...

includemacro/0.11/includemacro/__init__.py
*** downloaded {'CRC': 0,
 'comment': '',
 'compress_size': 2L,
 'compress_type': 8,
 'create_system': 3,
 'create_version': 20,
 'date_time': (2007, 1, 9, 7, 15, 14),
 'external_attr': 0L,
 'extra': '',
 'extract_version': 20,
 'file_offset': 72L,
 'file_size': 0L,
 'filename': 'includemacro/0.11/includemacro/__init__.py',
 'flag_bits': 0,
 'header_offset': 0L,
 'internal_attr': 0,
 'orig_filename': 'includemacro/0.11/includemacro/__init__.py',
 'reserved': 0,
 'volume': 0}
+++  re-zipped {'CRC': 0,
 'comment': '',
 'compress_size': 0L,
 'compress_type': 0,
 'create_system': 3,
 'create_version': 23,
 'date_time': (2007, 1, 9, 7, 15, 14),
 'external_attr': 2175008768L,
 'extra': 'UT\x05\x00\x03\xf22\xa3EUx\x00\x00',
 'extract_version': 10,
 'file_offset': 308L,
 'file_size': 0L,
 'filename': 'includemacro/0.11/includemacro/__init__.py',
 'flag_bits': 0,
 'header_offset': 215L,
 'internal_attr': 0,
 'orig_filename': 'includemacro/0.11/includemacro/__init__.py',
 'reserved': 0,
 'volume': 0}

includemacro/0.11/includemacro/macros.py
*** downloaded {'CRC': 1468807806,
 'comment': '',
 'compress_size': 1478L,
 'compress_type': 8,
 'create_system': 3,
 'create_version': 20,
 'date_time': (2008, 5, 6, 7, 52, 52),
 'external_attr': 0L,
 'extra': '',
 'extract_version': 20,
 'file_offset': 144L,
 'file_size': 4230L,
 'filename': 'includemacro/0.11/includemacro/macros.py',
 'flag_bits': 0,
 'header_offset': 74L,
 'internal_attr': 0,
 'orig_filename': 'includemacro/0.11/includemacro/macros.py',
 'reserved': 0,
 'volume': 0}
+++  re-zipped {'CRC': 1468807806,
 'comment': '',
 'compress_size': 1478L,
 'compress_type': 8,
 'create_system': 3,
 'create_version': 23,
 'date_time': (2008, 5, 6, 7, 52, 52),
 'external_attr': 2175008768L,
 'extra': 'UT\x05\x00\x034\xf2\x1fHUx\x00\x00',
 'extract_version': 20,
 'file_offset': 399L,
 'file_size': 4230L,
 'filename': 'includemacro/0.11/includemacro/macros.py',
 'flag_bits': 0,
 'header_offset': 308L,
 'internal_attr': 1,
 'orig_filename': 'includemacro/0.11/includemacro/macros.py',
 'reserved': 0,
 'volume': 0}

includemacro/0.11/setup.py
*** downloaded {'CRC': -555718993,
 'comment': '',
 'compress_size': 446L,
 'compress_type': 8,
 'create_system': 3,
 'create_version': 20,
 'date_time': (2008, 5, 6, 7, 52, 52),
 'external_attr': 0L,
 'extra': '',
 'extract_version': 20,
 'file_offset': 1678L,
 'file_size': 794L,
 'filename': 'includemacro/0.11/setup.py',
 'flag_bits': 0,
 'header_offset': 1622L,
 'internal_attr': 0,
 'orig_filename': 'includemacro/0.11/setup.py',
 'reserved': 0,
 'volume': 0}
+++  re-zipped {'CRC': -555718993,
 'comment': '',
 'compress_size': 446L,
 'compress_type': 8,
 'create_system': 3,
 'create_version': 23,
 'date_time': (2008, 5, 6, 7, 52, 52),
 'external_attr': 2175008768L,
 'extra': 'UT\x05\x00\x034\xf2\x1fHUx\x00\x00',
 'extract_version': 20,
 'file_offset': 1954L,
 'file_size': 794L,
 'filename': 'includemacro/0.11/setup.py',
 'flag_bits': 0,
 'header_offset': 1877L,
 'internal_attr': 1,
 'orig_filename': 'includemacro/0.11/setup.py',
 'reserved': 0,
 'volume': 0}

includemacro/0.11/README
*** downloaded {'CRC': -1243724499,
 'comment': '',
 'compress_size': 707L,
 'compress_type': 8,
 'create_system': 3,
 'create_version': 20,
 'date_time': (2008, 5, 17, 18, 25, 14),
 'external_attr': 0L,
 'extra': '',
 'extract_version': 20,
 'file_offset': 2178L,
 'file_size': 1304L,
 'filename': 'includemacro/0.11/README',
 'flag_bits': 0,
 'header_offset': 2124L,
 'internal_attr': 0,
 'orig_filename': 'includemacro/0.11/README',
 'reserved': 0,
 'volume': 0}
+++  re-zipped {'CRC': -1243724499,
 'comment': '',
 'compress_size': 707L,
 'compress_type': 8,
 'create_system': 3,
 

[Trac] Re: [trac-hacks] zip download permissions

2009-03-24 Thread Michael Renzmann

Hi.

 This behaviour started some time ago, I did not experience such
 problems before. Maybe when trac-hacks moved to the new server?

I'm all open for suggestions where to look for why this happens.

 I also filed a ticket in the trac-hacks bug tracker:
 http://trac-hacks.org/ticket/4724

I noticed that ticket when it was created, and intended to look into
possible reasons. However, so far I had no success, then was sidetracked
by other things and forgot to reply to it. Sorry.

 or is there some evil firewall or whatnot hackery in place that
 mysteriously strips down permissions?

At least on the server side there is no such thing that could look modify
zip files while they are downloaded.

Bye, Mike

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Trac 
Users group.
To post to this group, send email to trac-users@googlegroups.com
To unsubscribe from this group, send email to 
trac-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~--~~~~--~~--~--~---