Comment 2 for bug 50568

Revision history for this message
John A Meinel (jameinel) wrote : Re: 'bzr push' does not preserve sgid bit on newly created directories

The problem is that frequently we need to step outside the umask. Or at least I was hoping to be able to do that.

My use case is this: the default umask on a machine is likely to be 0022. Which is nice that the files in my home directory don't default to being world writeable.
But I'm also committing to a shared branch in say /home/shared/bzr/foo
We set the sgid bit on 'foo' and all the subdirs, (g+Srw). All files are g+rw.
The problem is that when we create a new directory that is a subdir (say a new entry like .bzr/repository/knits/aa) that directory should also be g+Srw (02770 for example).
However, because the default umask is 0022, sftp will create that as 02750, and if we sftp.chmod(02770), the sftp server will strip the gid bits, and create it as 00770. (g+rw).

We're pretty screwed either way. We can't set the sticky bit over sftp, and we can't set the write bit without resetting the sticky bit.