[RFC] per-branch umask

John Arbash Meinel john at arbash-meinel.com
Tue Dec 13 18:55:04 GMT 2005


I'm getting geared up to switch some people over to bzr, (if people
couldn't tell), so I'm working through some of the current things that
make it difficult.

We would like to have a shared public branch, which means the files need
to be group writeable. However, in our home directories, I don't want to
let everyone read my files, so my default umask is 0022.

Now, I can write a wrapper which sets umask to 0002, and then runs bzr,
but that only works locally, not over sftp. And it means that when
working in my local directory, things will be group writeable, which I
don't want. I just want them group writeable in the public directory. If
only the unix sticky bit could do more than just set the group owner.

I think it would be nice to have a umask value set for a branch, so that
clients will respect it when committing to that directory. That would
mean it needs to be inside .bzr, so that all clients see it.

I also don't know how to make it work over sftp. As near as I can tell,
there isn't an sftp UMASK command. For arch on my home machine, I
wrapped the sftp program with a bash script which sets the umask, and I
can convince the admin to do that for bzr if I have to.

Are there any other possible solutions?

I could probably write a plugin, which would wrap around
WorkingTree.commit() or something like that (though it is a branch
property, not a working tree one).

I would like to see it in bzr core, if people think it is worth anything.

To fill out a few more details:
 I don't think 'bzr branch' should copy the file.
 I don't care about the working tree, I only really want the umask to be
   set for ancestry. So I do want to be able to set it when we get
   branches without working trees.
 I'm not sure when to set umask, since if you pull from another branch,
   you should only use the local umask. I'm pretty sure we currently
   don't have any operations which write to 2 branches at the same time.
   So we probably could get away with only setting the umask once.
   Perhaps just when we call 'branch.lock_write()'. Is that sane?

Comments are welcome,
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/20051213/ab8ff1b4/attachment.pgp 


More information about the bazaar mailing list