file upload should not assume 0664 permissions
|||bzr Upload plugin||
I've noticed that on upload, the file permissions are being set as group writable e.g -rw-rw-r-- (0664). I tracked down this ( I think) in __init__.py, line 119 (note directories are also given rwx permissions for group).
The problem is that I'm dealing with a dumb server (out of my control) that is set up to disallow running of PHP files that are group writable. I have to log in and update the permissions of each file that is uploaded, post bzr upload, which is a pain if I upload 100's of files :(
def upload_file(self, relpath, id, mode=None):
if mode is None:
if not self.quiet:
Output of bzr ann __init__.py:
46 v.ladeu | def upload_file(self, relpath, id, mode=None):
| if mode is None:
| if self.tree.
| mode = 0775
| mode = 0664
34 argenti | if not self.quiet:
46 v.ladeu | self.to_
I notice that there is a mode arg, defaulting to None, which looks to be the default for the upload from where i can see this method being called. There is no mode help in "bzr help upload" so I'm not sure who to force the mode I want.
This seems to be a recent change as the upload was working ok before the last couple of pulls I did to get the latest code.
A solution would be to set the same permissions as the local file. e.g if my local file is -rw-r--r-- then set "mode = 0644"
Here is what I did (on a currently bzr-upload enabled directory)
ls -l test.php
-rw-r--r-- 1 me me 10 2008-10-14 12:07 test.php
ls -la .
drwxr-xr-x 16 me me 12288 2008-10-14 12:07 .
drwxr-xr-x 29 me me 4096 2008-10-13 12:53 ..
bzr add test.php
bzr commit -m "test file permission bug" test.php
bzr upload ftp://user@
//check permissions on remote side with FTP client for file test.php
expected result: -rw-r--r--
I manually changed 0664 to 0644 at line 119 and it worked as I expect (but that's obviously not the solution for every case).
|Robert Collins (lifeless) wrote : Re: [Bug 282983] [NEW] file upload should not assume 0664 permissions||#1|
|Robert Collins (lifeless) wrote : Re: [Bug 282983] [NEW] file upload should not assume 0664 permissions||#3|
|Vincent Ladeuil (vila) wrote : Re: [Bug 282983] [NEW] file upload should not assume 0664 permissions||#4|
|Changed in bzr-upload:|
|status:||New → Confirmed|
|importance:||Undecided → High|