sftp can't preserve uploaded mtime: fsetstat: No such file or directory

ilya Basin basinilya at gmail.com
Fri Aug 2 17:22:36 AEST 2024


I'm connecting to "EFT Server" https://www.globalscape.com/eft and it has an SFTP module. It has nothing to do with OpenSSH, but enterprise likes it for some reason. I don't control the server.

Looks like EFT doesn't support SSH2_FXP_FSETSTAT (working with a file handle), but it does support SSH2_FXP_SETSTAT (working with a file path). OpenSSH sftp only uses SSH2_FXP_FSETSTAT for directories. It doesn't have a separate "touch" command to set mtime for a path and its "chmod" command doesn't support that either.

    sftp> put MRW_PM_Series_17146_PSSF_T1_HB.zip /tempupload1/
    debug3: Looking up MRW_PM_Series_17146_PSSF_T1_HB.zip
    debug2: Sending SSH2_FXP_STAT "/tempupload1/"
    debug3: Sent message fd 7 T:17 I:2
    debug3: Received stat reply T:105 I:2 F:0x000c M:40766
    Uploading MRW_PM_Series_17146_PSSF_T1_HB.zip to /tempupload1/MRW_PM_Series_17146_PSSF_T1_HB.zip
    debug2: sftp_upload: upload local "MRW_PM_Series_17146_PSSF_T1_HB.zip" to remote "/tempupload1/MRW_PM_Series_17146_PSSF_T1_HB.zip"
    debug2: Sending SSH2_FXP_OPEN "/tempupload1/MRW_PM_Series_17146_PSSF_T1_HB.zip"
    debug3: Sent dest message SSH2_FXP_OPEN I:3 P:/tempupload1/MRW_PM_Series_17146_PSSF_T1_HB.zip M:0x001a
    debug3: Sent message SSH2_FXP_WRITE I:5 O:0 S:32768
    debug3: SSH2_FXP_STATUS 0
    debug3: In write loop, ack for 5 32768 bytes at 0
    debug3: Sent message SSH2_FXP_WRITE I:6 O:32768 S:32768
    ...
    debug3: In write loop, ack for 35 17707 bytes at 983040
    debug2: Sending SSH2_FXP_FSETSTAT
    debug3: Sent message fd 7 T:10 I:4 F:0x000c M:00644
    debug3: SSH2_FXP_STATUS 2
    remote fsetstat: No such file or directory


-------- Original Message --------
From: Damien Miller [mailto:djm at mindrot.org]
Sent: Thursday, August 1, 2024 at 00:42 UTC
To: ilya Basin
Cc: Brian Candler; openssh-unix-dev at mindrot.org
Subject: sftp can't preserve uploaded mtime: fsetstat: No such file or directory

On Wed, 31 Jul 2024, ilya Basin wrote:

I've just tried that. It still fails.

Is it possible to dump the decrypted sftp commands? I tried -vvv but found nothing interesting.

Try

Subsystem       sftp    /usr/libexec/sftp-server -l debug3

in sshd_config

The Total Commander plugin calls:

    libssh2_sftp_setstat(ConnectSettings->sftpsession,
    					thename,&attr)

What does the command line client use?


-------- Original Message --------
From: Brian Candler [mailto:b.candler at pobox.com]
Sent: Wednesday, July 31, 2024 at 15:42 UTC
To: ilya Basin; openssh-unix-dev at mindrot.org
Subject: sftp can't preserve uploaded mtime: fsetstat: No such file or directory

On 31/07/2024 16:28, ilya Basin wrote:
I use openssh-client 1:8.9p1-3ubuntu0.6 and I'm trying to upload files to EFT Server.

Previously I was using Total Commander with SFTP plugin and it does preserve mtime. https://www.ghisler.com/plugins.htm

When I try to do the same from command line it fails.

    $ sftp -p user at server <<< 'put MRW_PM_Series_17146_PSSF_T1_HB.zip "/0_GLS to be automated/2024_batch_Q3/"'
    
    (user at server) Enter password: credentials to continue
    Connected to server.
    sftp> put MRW_PM_Series_17146_PSSF_T1_HB.zip "/0_GLS to be automated/2024_batch_Q3/"
    Uploading MRW_PM_Series_17146_PSSF_T1_HB.zip to /0_GLS to be automated/2024_batch_Q3/MRW_PM_Series_17146_PSSF_T1_HB.zip
    MRW_PM_Series_17146_PSSF_T1_HB.zip                                                    100%  977KB   1.0MB/s   00:00
    remote fsetstat: No such file or directory

Just a thought: does it work if the target directory name doesn't include spaces?


_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev at mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




More information about the openssh-unix-dev mailing list