File permissions after FTP push

Lukas Zapletal lukas91 at zapletalovi.com
Tue Mar 3 10:26:25 GMT 2009


Resending response by Vincent:

 >>>>> "LZ" == Lukáš Zapletal <lukas at zapletalovi.com> writes:

    >>    LZ> I am pushing my repos via FTP on my site and making it
    >>    LZ> public with Apache (HTTP). The problem is when I create
    >>    LZ> my repo and push it via FTP the permissions of all files
    >>    LZ> and directories in the .bzr dir is 700. This means Apache
    >>    LZ> (running under different user) is not able to read.
    >>
    >> bzr itself try to set chmod bits as 755 or 644 by default if the
    >> server supports it. Try to look at your .bzr.log file for
    >> messages like:
    >>
    >>  "FTP site chmod: setting permissions to %s on %s",
    >>  "FTP Could not set permissions to %s on %s. %s",
    >>
    >> If you end up with 700, you should also check that your ftp
    >> server support the chmod bits and what umask it is enforcing.

    LZ> Heres the log:

    LZ> 0.063  encoding stdout as sys.stdout encoding 'UTF-8'
    LZ> 0.064  bzr arguments: [u'push', 
u'ftp://xxxxx@yyyyy.com/repub/bzr/tox264']
    LZ> 0.065  looking for plugins in /home/lzap/.bazaar/plugins
    LZ> 0.065  looking for plugins in 
/usr/lib/python2.5/site-packages/bzrlib/plugins
    LZ> 0.065  Plugin name __init__ already loaded
    LZ> 0.065  Plugin name __init__ already loaded
    LZ> 0.111  bzr-svn: using Subversion 1.5.1 ()
    LZ> 0.189  encoding stdout as sys.stdout encoding 'UTF-8'
    LZ> 0.213  FTP get: /repub/bzr/tox264/.bzr/branch-format
    LZ> 0.214  Constructing FTP instance against ('yyyyyy.com', None,
    LZ> 'myuser', '********', False)
    LZ> 2.517  opening SVN RA connection to 
'ftp://xxxxx@yyyyy.com/repub/bzr/tox264'
    LZ> 2.521  Unable to open <bzrlib.transport.ftp.FtpTransport
    LZ> url=ftp://xxxxx@yyyyy.com/repub/bzr/tox264/> with Subversion:
    LZ> Unrecognized URL scheme for 'ftp://xxxxx@yyyyy.com/repub/bzr/tox264'
    LZ> 2.522  FTP mkd: /repub/bzr/tox264
    LZ> 2.527  FTP mkd: /repub/bzr/tox264
    LZ> 2.562  opening working tree '/home/lzap/projects/tox264'
    LZ> 2.562  FTP stat: /repub/bzr/tox264
    LZ> 2.580  FTP mkd: /repub/bzr/tox264/.bzr
    LZ> 2.585  FTP site chmod: setting permissions to 448 on 
/repub/bzr/tox264/.bzr

oct(448) -> '0700'

Eerk ! Bzr ! What are you doing !

...


Ok, things has evolved a bit since the last time I checked the
code.

It appears that we start by getting the chmod bits from the base
dir, so roughly: ftp://xxxxx@yyyyy.com/repub/bzr/tox264 or
ftp://xxxxx@yyyyy.com/repub/bzr, depending on whether you first
ask for tox264 creation or not.

The idea is to respect whatever mode bits has been set there
(including writable by group, etc) but not the sticky bits
though.

Relevant code is bzrlib.BzrDir.bzrdir._find_creation_modes.

So, you should first set the right chmod bits *on the server* for
your directory (delete the existing one or do a chmod -R).

Can you try again and let me know how it works ?





More information about the bazaar mailing list