[RFC] per-branch umask

John Arbash Meinel john at arbash-meinel.com
Wed Dec 14 17:16:02 GMT 2005


Jan Hudec wrote:
> On Tue, Dec 13, 2005 at 14:25:14 -0600, John Arbash Meinel wrote:

...

>>
>>I agree that there is a lot of overhead of new stat calls. If people
>>think that just the permission of .bzr is sufficient it is easier to
>>implement. It probably means that put will need to have a mode, since it
>>won't know what .bzr is (Transports don't know anything about layout,
>>they just move files around).
> 
> 
> Sftp does not support setting umask, so doing chmod sounds reasonable
> there.
> 
> For local transport, why can't it:
> * set umask to 0
> * use os.open instead of open and pass the desired mode in.
> (depends on whether anything except local transport can create files).
> 
> They may not behave consistently with each other (since local transport
> would not modify permissions of existing files while sftp might), but I
> don't think there is a problem with that. Let's require all the storage
> files in .bzr have the same permissions.

I think for consistency, we can just have 'put()' take a mode parameter.
I would rather not set umask, since local files will be created with
umask (though you could reset it afterwards). But I think passing a
mode, and just having a os.fchmod() call isn't a lot of overhead.
For sftp, it would imply an extra round trip for the chmod request, but
I don't think it is terrible.

I think an easy thing to do would be to update things so that when a
branch opens itself, it tries to figure out what the mode of the .bzr
directory is. Alternatively, we could do it the first time we get a put
request. We could also have each store keep track of this, so that
Branch doesn't have to pass to Store what mode it wants. (Or Branch
could just pass it to Store as a initial parameter).

Anyway, I'm happy saying everything underneath .bzr/ should have the
same permissions. And I don't think it adds a lot of overhead.

What about Aaron, Martin, or Robert, do you agree?

John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051214/b907b4eb/attachment.pgp 


More information about the bazaar mailing list