[Zope-CMF] GenericSetup creates exports with bad directory permissions

Maurits van Rees m.van.rees at zestsoftware.nl
Thu Mar 4 09:22:12 EST 2010


Maurits van Rees, on 2010-03-03:
> Right, by default this gets mode 420 and it should be 493.
>>>> tarfile.filemode(493)
> '-rwxr-xr-x'
>>>> oct(493)
> '0755'

As Wichert wrote in the zope-checkins list, it is clearer to write
"tarfile.filemode(0755)".  I tried doing that before my commit but got
octals and hexadecimals confused and tried with 0x755, which did not
quite work of course.  Fixed on trunk now in r109648 to indeed use the
octal 0755.


For laughs, I could not figure those numbers out yesterday, so how I
came to that value of 493 was by brute forcing it like this in a
python prompt:

>>> import tarfile
>>> goal = '-rwxr-xr-x'
>>> for i in range(1000):
...     if tarfile.filemode(i) == goal:
...         print i
... 
493

:-)

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
What are you going to create today?



More information about the Zope-CMF mailing list