IETF-SSH archive

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

Re: sftp rename not good.



At 03:57 PM 5/13/2003, Alfred Perlstein wrote:
* Joseph Galbraith <galb-list%vandyke.com@localhost> [030513 12:28] 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?

That's the cause of the problem.

The actual problem is that it doesn't seem possible to do atomic
updates of files using sftp because of the way SSH_FXP_RENAME must
be implemented.

Also, I _think_ that using link(2) (without fsync) instead of
rename(2) allows for the system to lose the file completely
during an outtage.

I think there should be some way of invoking an actual rename(2)
on the server.

That would be best, IMHO.  That way, you can implement server-specific
behavior.  For example, those of us on VMS have versioned file systems,
so the behavior of a rename on VMS could be drastically different than
that on a UNIX system.

------
+-------------------------------+----------------------------------------+
| Dan O'Reilly                  |  "There are 10 types of people in this |
| Principal Engineer            |   world: those who understand binary   |
| Process Software              |   and those who don't."                |
| http://www.process.com        |                                        |
+-------------------------------+----------------------------------------+





Home | Main Index | Thread Index | Old Index