login about faq

Hi,

I'm trying to write script to fetch few files from freeFTPd SFTP-server with Tectia SCPg3 (or SFTPg3) -client.

It works well, if I define exact filename to my script, but there is some issue with the wildcards..

Below are some logs taken from SFTP, connected with debug level 3:

sftp> ls
22/12/2014 10:16:35:129 SshReadLine/sshreadline.c:745: Read a line from console:
 ls
test1.txt
test2.txt
test3.txt
22/12/2014 10:16:35:186 SshReadLine/sshreadline.c:743: Reading a line from console.
sftp> mget *.txt
22/12/2014 10:16:39:955 SshReadLine/sshreadline.c:745: Read a line from console: mget *.txt
22/12/2014 10:16:39:955 SftpAppLibSft/secsh_sft.c:4304: sftp-server didn't give newline convention.
22/12/2014 10:16:39:995 SecshFtTree/secshfttree_internal.c:4141: Unknown file attribute type: 5.
22/12/2014 10:16:39:995 SecshFtTree/secshfttree_internal.c:4141: Unknown file attribute type: 5.
22/12/2014 10:16:39:995 SecshFtTree/secshfttree_internal.c:4141: Unknown file attribute type: 5.
22/12/2014 10:16:39:996 SftpAppLibSft/secsh_sft.c:4304: sftp-server didn't give newline convention.
22/12/2014 10:16:39:996 SshReadLine/sshreadline.c:743: Reading a line from console.
sftp> mget test1.txt
22/12/2014 10:16:54:193 SshReadLine/sshreadline.c:745: Read a line from console: mget test1.txt
22/12/2014 10:16:54:193 SftpAppLibSft/secsh_sft.c:4304: sftp-server didn't give newline convention.
22/12/2014 10:16:54:207 SftpAppLibSft/secsh_sft.c:9594: Preparing ASCII conversion, src transfer mode 0, dst transfer mode 0, newline lengths: 2, 2
22/12/2014 10:16:54:207 SftpAppLibSft/secsh_sft.c:9899: ASCII conversion is OFF
22/12/2014 10:16:54:216 SftpAppLibSft/secsh_sft.c:9203: Copying file using traditional SFTP protocol, Src: 0 -> 0, Dst: 0 -> 0
22/12/2014 10:16:54:216 SftpAppLibSft/secsh_sft.c:9208: Copying file until EOF.
22/12/2014 10:16:54:217 SftpAppLibSft/secsh_sft.c:9295: No staging on local destination file.
test1.txt                          |     0B |       0B/s | TOC: 00:00:00 | 100%
22/12/2014 10:16:54:458 SftpAppLibSft/secsh_sft.c:4304: sftp-server didn't give newline convention.
22/12/2014 10:16:54:458 SshReadLine/sshreadline.c:743: Reading a line from console.
sftp>

If I understand that correct, it seems like directory listing is working anyway, because there is 3 times line: "SecshFtTree/secshfttree_internal.c:4141: Unknown file attribute type: 5.", and there is 3 files matching to pattern *.txt in source folder. Can someone tell me what means message "unknown file attribute type: 5?"

On freeFTPd's side I can't find anything helpful from logs, there is all it logged from below session:

SFTP testuser connected
SFTP testuser is changing dir to / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\test1.txt)
SFTP testuser is listing / (C:\Users\testuser\Documents\SFTP\test1.txt)
SFTP testuser is downloading /test1.txt (C:\Users\testuser\Documents\SFTP\test1.txt)
SFTP testuser transfer complete
SFTP testuser disconnected

With psftp-client mget-command works as expected:

psftp> mget *.txt
    remote:/test1.txt => local:test1.txt
    remote:/test2.txt => local:test2.txt
    remote:/test3.txt => local:test3.txt
psftp>

I would very much appreciate any help or guidance with this, thank you in advance!

asked Dec 23 '14 at 15:15

Fraction's gravatar image

Fraction
6114

edited Dec 23 '14 at 15:17

Hmmm I tried to reproduce it with latest freeFTPd from the provided link, but some process crashes during installation, though it claims to be successful. Later the freeFTPd always crashes on startup. That is on WinXP 32bit. I will try some other machine....

(Dec 23 '14 at 22:40) Martin Dobsik ♦ Martin%20Dobsik's gravatar image

I managed to reproduce it on Windows 7.

(Dec 24 '14 at 00:07) Martin Dobsik ♦ Martin%20Dobsik's gravatar image

It seems to me that freeSSHd does not send file type in file attributes (permissions -- S_IFMT) when responding to readdir request. It does indicate a directory, but not files. Tectia file transfer clients refuse to transfer entities with unknown type. That is when using mget *.txt.

When doing get test1.txt, client issues 'stat' request. freeSSHd server replies with file type set to S_IFREG as expected. And everything works fine.

So I guess it is an inter-operability issue. Tectia file transfer clients could be more permissive and try to do as much as they can with object of unkown type -- assuming they are regular files. freeSSHd should, perhaps, claim file type in attributes returned in response to readdir request (FXP_NAME), especially when it knows the type.

But I may be wrong, I did just quick debugging session...

BTW: as you probably know, the opposite direction: put, works fine at least with similar test case.

link

answered Dec 24 '14 at 00:23

Martin%20Dobsik's gravatar image

Martin Dobsik ♦
599126

Developer of freeFTPd published new version of his software (1.0.13), now it works as expected. Thank you for your help Martin, it probably guided him to right direction.

link

answered Jan 18 '15 at 19:03

Fraction's gravatar image

Fraction
6114

I am glad to hear that. I am also glad if I could help in some way. Perhaps also SSH Tectia will get this fixed one day, because we have seen some other servers behaving the same way.

(Jan 20 '15 at 00:17) Martin Dobsik ♦ Martin%20Dobsik's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×28
×10

Asked: Dec 23 '14 at 15:15

Seen: 2,689 times

Last updated: Jan 20 '15 at 00:17

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.