[RFC] per-branch umask

John Arbash Meinel john at arbash-meinel.com
Thu Dec 15 21:19:20 GMT 2005


Jan Hudec wrote:
> On Thu, Dec 15, 2005 at 12:46:07 -0600, John Arbash Meinel wrote:
> 
>>Matthieu Moy wrote:
>>
>>>Jan Hudec <bulb at ucw.cz> writes:
>>>
>>>
>>>
>>>>Ok or not, sftp does not support setting umask, so it's the only way
>>>>(short of requiring users to create wrapers for the sftp server).
>>>
>>>
>>>If the performance loss is visible, then there should be a way to
>>>disable the chmod.
>>>
>>
>>Actually, I found a better way. The CMD_OPEN call for sftp lets you
>>specify a file mode at creation time.
>>Since sftp.put() always uses _sftp_open_exclusive() and puts the file
>>into a temporary file, we probably don't have to chmod the file again.
> 
> 
> So does open -- but masks it with umask. Isn't sftp the same case?

Actually, the StubSFTPServer that we use does *not* mask anything when
it does an open or mkdir. Which means that all the test cases pass, but
in actually testing it with a real sftp server, I found that the tests
don't pass. Thanks for reminding me of this.

So yes, there will be an extra chmod call. I found the part where
mkdir() was doing it already. I don't know why I didn't look at open at
the same time.

John
=:->


> 
> 
>>Which means that the only real overhead is an extra stat() call when you
>>open the branch, to determine the permissions of the branch. And a
>>couple extra bytes which pass the mode bits.
>>
>>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/20051215/712db4f4/attachment.pgp 


More information about the bazaar mailing list