Bug 1400 - add atomic rename extension to sftp-server
Summary: add atomic rename extension to sftp-server
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp-server (show other bugs)
Version: -current
Hardware: All All
: P2 enhancement
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_4_8
  Show dependency treegraph
 
Reported: 2007-12-11 07:57 AEDT by Miklos Szeredi
Modified: 2023-01-13 13:56 AEDT (History)
1 user (show)

See Also:


Attachments
[PATCH] add atomic rename extension to sftp-server (1.10 KB, patch)
2007-12-11 08:03 AEDT, Miklos Szeredi
no flags Details | Diff
Tweaked patch (1.47 KB, patch)
2008-02-24 12:04 AEDT, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Miklos Szeredi 2007-12-11 07:57:59 AEDT
This is needed to be able to support a rename() operation conforming
to POSIX in the SSH filesystem.

With the rename operation defined in the SFTP spec, this is
impossible, since in case the target exists it's not possible to
perform the rename+unlink atomically.

The patch applies on top of the statfs extension patch.
Comment 1 Miklos Szeredi 2007-12-11 08:03:45 AEDT
Created attachment 1394 [details]
[PATCH] add atomic rename extension to sftp-server
Comment 2 Damien Miller 2008-02-24 12:04:54 AEDT
Created attachment 1456 [details]
Tweaked patch

We should advertise the presence of the extension in the FXP_VERSION reply packet. Also, the official OpenSSH domain is "openssh.com", "openssh.org" was taken by a domain squatter and is not trustworthy (it could redirect at any time).
Comment 3 Damien Miller 2008-02-28 07:22:18 AEDT
patch applied - thanks. This will be available in openssh-4.8
Comment 4 Miklos Szeredi 2008-02-28 07:54:58 AEDT
Great, thanks.  This will solve a really long standing issue with sshfs.
Comment 5 Damien Miller 2008-03-31 15:23:01 AEDT
Fix shipped in 4.9/4.9p1 release.