file upload should not assume 0664 permissions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Breezy |
Triaged
|
Medium
|
Unassigned | ||
bzr Upload plugin |
Confirmed
|
High
|
Unassigned |
Bug Description
Hi
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 :(
<pre>
def upload_file(self, relpath, id, mode=None):
if mode is None:
if self.tree.
else:
if not self.quiet:
</pre>
Output of bzr ann __init__.py:
<pre>
46 v.ladeu | def upload_file(self, relpath, id, mode=None):
| if mode is None:
| if self.tree.
| mode = 0775
| else:
| mode = 0664
34 argenti | if not self.quiet:
| self.outf.
46 v.ladeu | self.to_
</pre>
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)
touch test.php
ls -l test.php
-rw-r--r-- 1 me me 10 2008-10-14 12:07 test.php
//current directory
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@
Uploading test.php
//check permissions on remote side with FTP client for file test.php
result: -rw-rw-r--
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).
Thanks!
James
Changed in bzr-upload: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in brz: | |
status: | New → Triaged |
importance: | Undecided → Medium |
tags: | added: upload |
You can set your umask to filter out group and world bits if you like.
bzr shouldn't override that.
-Rob