[merge][rfc] test that Transport.append sets permissions on existing files
Martin Pool
mbp at sourcefrog.net
Fri Aug 17 09:31:20 BST 2007
On 8/17/07, Martin Pool <mbp at sourcefrog.net> wrote:
> It might be reasonable to say that Transport callers should always
> know whether the file they're creating will exist or not, and call
> put_* or append respectively. This would let us have some checks
> against things like the paramiko misbehaviour reported a while ago.
>
> My question was really about the more common use of append to write to
> an existing file. Does it need to reset the permissions then? I
> wouldn't think so, since that would imply they were wrong before.
> Unless someone knows a reason why it's in there, I'd rather remove the
> code that does it.
I thought about this some more and realized that the problem is that
even on initial creation, we have to stat the file to make sure our
mode took effect and was not masked by the umask. On later calls we
have to stat it to get the length. So really there is not much to be
gained by removing this. I think I'll go ahead and add the test then.
--
Martin
More information about the bazaar
mailing list