Subject: New SFTP extension: copy files on server...

From: Joseph Galbraith <[email-masked]>
Date: Tue, 30 Aug 2005 08:15:27 -0600

I know I promised we were done adding complexity,
but as an non-mandatory extension, I think this
could provide a significant performance optimization
for some users:

        byte   SSH_FXP_EXTENDED
        uint32 request-id
        string "copy"
        string src-path [UTF-8]
        string dst-path [UTF-8]
        UINT   cpy-flags

cpy-flags would be:

   SFX_CPY_RECURSIVE
     Without this flag, src-path most not be a directory

   SFX_CPY_OVERWRITE
     This flag requests that if 'dst-path' exists, it be
     overwritten.

     Because of the semantics of the copy operation (and
     limitations on the server) it is not possible to
     overwrite a directory.

   SFX_CPY_PRESERVE
     This flag requests the server to preserve mode,
     owner, group, and access control lists.

     What is actually preserved is implementation dependent.

If 'dst-path' does not exist, the server uses the exact
path specified in 'dst-path' for the destination.

If 'dst-path' exists, and is a directory, the server uses
the builds the actual 'dst-path' by combining the specified
path with the last component of the src-path.

If the 'dst-path' derived in this fashion already exists,
and is a folder, and the src-path is not a folder, it
is an error.

If the src-path is a folder, and SFX_CPY_OVERWRITE is specified,
the files from the src-path are copied into the target folder,
overwriting an files that have the same name.  Files already
existing in the dst-path that are not in the src-path are not
changed in any way.

Thoughts?  Hate it?  Love it, but it needs X?

Thanks,

Joseph

---

From: der Mouse <[email-masked]>
Date: Tue, 30 Aug 2005 11:19:02 -0400 (EDT)

> [...]

> Thoughts?  Hate it?  Love it, but it needs X?

I'm with Richard Whalen: fine, but not in the core draft.

In fact, I'm not convinced _any_ SSH_FXP_EXTENDED packets belong in the
core draft (yes, I know there are a handful of them there now).

That aside, the description uses both "folder" and "directory",
apparently referring to the same thing; I think the terminology should
be normalized to the same as the rest of the sftp stuff.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       [email-masked]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

---

From: Joseph Galbraith <[email-masked]>
Date: Tue, 30 Aug 2005 10:10:34 -0600

> core draft (yes, I know there are a handful of them there now).

I suppose I could be convinced to move some of them--
like the hash stuff would be a good candidate.  Some
of the others though, I do think belong there.

version-select and space-available at least belong in the
core draft.

I could go either way about 'home-directory'

> be normalized to the same as the rest of the sftp stuff.

That is a good point... I'll check the entire draft
and normalize to 'directory.'  I despise that fact that I've
become so corrupt I all them folders :-)

Thanks,

Joseph

---

From: der Mouse <[email-masked]>
Date: Tue, 30 Aug 2005 12:27:21 -0400 (EDT)

>> In fact, I'm not convinced _any_ SSH_FXP_EXTENDED packets belong in
>> the core draft (yes, I know there are a handful of them there now).

> I suppose I could be convinced to move some of them-- like the hash
> stuff would be a good candidate.  Some of the others though, I do
> think belong there.

> version-select and space-available at least belong in the core draft.

version-select, hmm, I think I agree.  The others, I think I'm readier
to push them out than you are, but since I don't feel strongly enough
about it to make a fuss over any of them, it doesn't really matter. :)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign