IETF-SSH archive

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

Re: sftp rename not good.



On 13 May 2003, 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?

I think the fact that SSH_FXP_RENAME is impossible to reliably
implemented on Unix is a serious problem.  Secondarily it is a shame
that it prevents use of the atomic-rename Unix idiom.

I would like to suggest that the phrasing be changed to 

  The server MAY return SSH_FX_FILE_ALREADY_EXISTS if there exists a
  file with the name specified by newpath.

Clients which wish to always replace the path without knowing the
server filesystem can precede the rename operation with an attempt to
delete the destination file.  That does not seem to be an undue
burden.

Clients which know the server is Unix and which wish to take advantage
of atomic replace can do so.

-- 
Martin 



Home | Main Index | Thread Index | Old Index