IETF-SSH archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sftp rename not good.



Joseph Galbraith <galb-list%vandyke.com@localhost> wrote:
> Let me make sure I understand the problem:
> 
> - SSH_FXP_RENAME specifies that it is an error if the new file exists.
> - rename(2) specifies that if the new file exists, it is always overwritten.
> Therefore rename(2) can't be used to implement SSH_FXP_RENAME.
> 
> Is this a correct summary of the problem?

AIUI, that's only half the problem. The other half is that
SSH_FXP_RENAME can't be used to implement rename(2)!

The rename(2) semantics are useful if you want to avoid race
conditions with other processes reading a file: you create a new
version of the file under a different name, and atomically rename(2)
it over the top of the old one, and at _all_ observable instants on
the server there is a file with valid contents stored under the
original name. I believe it's being asserted that this would be a
useful feature in SFTP.

Cheers,
Simon
-- 
Simon Tatham         "Thieves respect property; they only wish the property to
<anakin%pobox.com@localhost>    be their own, that they may more properly respect it."



Home | Main Index | Thread Index | Old Index