From 549dccd608a73015a4c44c8ab17a5b57c4810c2b Mon Sep 17 00:00:00 2001
From: david-sarah <david-sarah@jacaranda.org>
Date: Sun, 23 May 2010 19:11:56 -0700
Subject: [PATCH] SFTP: name of the POSIX rename extension should be
 'posix-rename@openssh.com', not 'extposix-rename@openssh.com'.

---
 src/allmydata/frontends/sftpd.py | 8 ++++----
 src/allmydata/test/test_sftp.py  | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/allmydata/frontends/sftpd.py b/src/allmydata/frontends/sftpd.py
index 819191a8..f9426622 100644
--- a/src/allmydata/frontends/sftpd.py
+++ b/src/allmydata/frontends/sftpd.py
@@ -876,7 +876,7 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin):
 
         # advertise the same extensions as the OpenSSH SFTP server
         # <http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=1.15>
-        return {'extposix-rename@openssh.com': '1',
+        return {'posix-rename@openssh.com': '1',
                 'statvfs@openssh.com': '2',
                 'fstatvfs@openssh.com': '2',
                }
@@ -1151,7 +1151,7 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin):
             # "It is an error if there already exists a file with the name specified
             #  by newpath."
             # For the standard SSH_FXP_RENAME operation, overwrite=False.
-            # We also support the extposix-rename@openssh.com extension, which uses overwrite=True.
+            # We also support the posix-rename@openssh.com extension, which uses overwrite=True.
 
             # FIXME: use move_child_to_path to avoid possible data loss due to #943
             #d2 = from_parent.move_child_to_path(from_childname, to_root, to_path, overwrite=overwrite)
@@ -1376,8 +1376,8 @@ class SFTPUserHandler(ConchUser, PrefixingLogMixin):
         # We implement the three main OpenSSH SFTP extensions; see
         # <http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=1.15>
 
-        if extensionName == 'extposix-rename@openssh.com':
-            def _bad(): raise SFTPError(FX_BAD_MESSAGE, "could not parse extposix-rename@openssh.com request")
+        if extensionName == 'posix-rename@openssh.com':
+            def _bad(): raise SFTPError(FX_BAD_MESSAGE, "could not parse posix-rename@openssh.com request")
 
             (fromPathLen,) = struct.unpack('>L', extensionData[0:4])
             if 8 + fromPathLen > len(extensionData): return defer.execute(_bad)
diff --git a/src/allmydata/test/test_sftp.py b/src/allmydata/test/test_sftp.py
index 55ca02ae..1b4a9032 100644
--- a/src/allmydata/test/test_sftp.py
+++ b/src/allmydata/test/test_sftp.py
@@ -1009,7 +1009,7 @@ class Handler(GridTestMixin, ShouldFailMixin, unittest.TestCase):
         def _renameFile(fromPathstring, toPathstring):
             extData = (struct.pack('>L', len(fromPathstring)) + fromPathstring +
                        struct.pack('>L', len(toPathstring))   + toPathstring)
-            return self.handler.extendedRequest('extposix-rename@openssh.com', extData)
+            return self.handler.extendedRequest('posix-rename@openssh.com', extData)
 
         d = self._set_up("renameFile_posix")
         d.addCallback(lambda ign: self._set_up_tree())
-- 
2.45.2