I try to upload a file via SFTP by a self-written program
that utilizes the library libssh2.
The client runs on a Windows host.
The server is freeFTPd which runs under Windows, too.

I always get a "permission denied" error as soon as I send
an "open" request to the server. More exactly: As soon
as I call that "open" function in the libssh2 library.

My question is:
Is this an error in libssh2 or in the server?

I do not know whether this "open" request makes its way
to the server or whether the "permission denied" message
is already coming from libssh2.
I switched on tracing in libssh2 and got the impression
that the error is coming from the server. However because I am not
sure I attached a part of that tracefile in the appendix.
The server logfile does not show an error.

I should note that the client runs fine under Linux.
However then the opposite side (server) is not freeFTPd
but sshd from OpenSSH.

Hans
[libssh2] 0.691364 SFTP: Enabling SFTP version 3 compatability
[libssh2] 0.691364 SFTP: Sending file open request
[libssh2] 0.691364 Conn: Writing 44 bytes on channel 0/1000, stream #0
[libssh2] 0.691364 Socket: Error recving 16384 bytes to 0x1f01948+0: 11
[libssh2] 0.691364 Conn: Sending 44 bytes on channel 0/1000, stream_id=0
=> libssh2_transport_write plain (53 bytes)
0000: 5E 00 00 03 E8 00 00 00  2C 00 00 00 28 03 00 00 : ^...è...,...(...
0010: 00 00 00 00 00 13 51 3A  5C 70 72 6A 5C 74 65 6D : ......Q:\prj\tem
0020: 70 5C 66 6C 74 2E 73 71  6C 00 00 00 1A 00 00 00 : p\flt.sql.......
0030: 04 00 00 81 B6                                   : ....¶
[libssh2] 0.691364 Socket: Sent 84/84 bytes at 0x1ea418c
=> libssh2_transport_write send() (84 bytes)
0000: 48 73 9E 8E F3 79 E9 9E  BE 19 CE 46 20 B0 90 73 : HsžŽóy鞟.ÎF °.s
0010: 3A DB 93 FC 4B 60 B1 18  D7 F0 76 97 36 A7 FD 0D : :ۓüK`±.×ðv—6§ý.
0020: 25 2A 9B 4E B4 26 66 49  FB B7 51 56 07 C9 4F 62 : %*›NŽ&fIû·QV.ÉOb
0030: A1 D5 77 7F F8 FE 92 D9  F5 68 F3 01 5D FC FA A0 : ¡Õw.øþ’Ùõhó.]üú 
0040: D7 38 30 A3 C8 26 E1 48  6E CB 14 D0 91 FE 11 D3 : ×80£È&áHnË.Бþ.Ó
0050: CB 06 C2 7C                                      : Ë.Â|
[libssh2] 0.691364 SFTP: Asking for 102 packet
[libssh2] 0.691364 SFTP: Asking for 101 packet
[libssh2] 0.691364 SFTP: recv packet
[libssh2] 0.691364 Socket: Error recving 16384 bytes to 0x1f01948+0: 11
[libssh2] 0.691364 Failure Event: -37 - Would block waiting for status message
[libssh2] 0.800743 SFTP: Asking for 102 packet
[libssh2] 0.800743 SFTP: Asking for 101 packet
[libssh2] 0.800743 SFTP: recv packet
[libssh2] 0.800743 Conn: channel_read() wants 4 bytes from channel 0/1000 
stream #0
[libssh2] 0.800743 Socket: Recved 84/16384 bytes to 0x1f01948+0
=> libssh2_transport_read() raw (84 bytes)
0000: D5 86 EE 17 31 E7 48 85  13 84 2A D5 C7 E7 70 6C : Նî.1çH….„*ÕÇçpl
0010: 53 60 C0 4D 26 5A A9 76  B0 F5 AB 05 35 98 9C 8B : S`ÀM&Z©v°õ«.5.œ‹
0020: 2B FD 0D 79 08 93 09 CC  37 5B 35 DC 85 0A C5 EF : +ý.y.“ Ì7[5܅.Åï
0030: 42 C0 AF 54 FF 65 2B 90  22 BB A6 70 36 98 73 03 : BÀ¯Tÿe+."»Šp6.s.
0040: D3 CE 82 3A 0B EC A5 BD  06 7C 57 CD FD F4 F7 B2 : Ó΂:.쥜.|WÍýô÷²
0050: 04 35 F8 D0                                      : .5øÐ
=> libssh2_transport_read() plain (47 bytes)
0000: 5E 00 00 00 00 00 00 00  26 00 00 00 22 65 00 00 : ^.......&..."e..
0010: 00 00 00 00 00 03 00 00  00 11 50 65 72 6D 69 73 : ..........Permis
0020: 73 69 6F 6E 20 64 65 6E  69 65 64 00 00 00 00    : sion denied....
[libssh2] 0.800743 Transport: Packet type 94 received, length=47
[libssh2] 0.800743 Conn: 38 bytes packet_add() for 0/1000/0
[libssh2] 0.800743 Socket: Error recving 16384 bytes to 0x1f01948+0: 11
[libssh2] 0.800743 Conn: channel_read() got 4 of data from 0/1000/0
[libssh2] 0.800743 SFTP: Data begin - Packet Length: 34
[libssh2] 0.800743 Socket: Error recving 16384 bytes to 0x1f01948+0: 11
[libssh2] 0.800743 Conn: channel_read() got 34 of data from 0/1000/0 [ul]
[libssh2] 0.800743 SFTP: Received packet 101 (len 34)
[libssh2] 0.800743 SFTP: Asking for 102 packet
[libssh2] 0.800743 SFTP: Asking for 101 packet
[libssh2] 0.800743 Failure Event: -31 - Failed opening remote file
[libssh2] 0.800743 SFTP: got FXP_STATUS 3
[libssh2] 0.800743 Transport: Disconnecting: reason=11, desc=error, lang=
=> libssh2_transport_write plain (18 bytes)
0000: 01 00 00 00 0B 00 00 00  05 65 72 72 6F 72 00 00 : .........error..
0010: 00 00                                            : ..
[libssh2] 0.800743 Socket: Sent 52/52 bytes at 0x1ea41e0
=> libssh2_transport_write send() (52 bytes)
0000: 51 A2 CC AC 31 67 1D 3F  30 62 DC 65 62 B4 14 0A : Q¢Ì¬1g.?0bÜebŽ..
0010: 75 D5 E2 44 02 49 DF 94  FE 6A B3 E5 2A B7 D8 EB : uÕâD.Iߔþj³å*·Øë
0020: 07 71 B0 49 1F C6 C9 5E  B5 E8 58 50 41 B9 AB 8D : .q°I.ÆÉ^µèXPA¹«.
0030: 16 AB 0E B4                                      : .«.Ž
[libssh2] 0.800743 Conn: Freeing channel 0/1000 resources
[libssh2] 0.800743 Conn: Sending EOF on channel 0/1000
=> libssh2_transport_write plain (5 bytes)
0000: 60 00 00 03 E8                                   : `...è
[libssh2] 0.800743 Socket: Sent 36/36 bytes at 0x1e94710
=> libssh2_transport_write send() (36 bytes)
0000: 88 99 7F B5 20 C4 25 C9  8E F4 9D 09 4C 99 DD AF : ...µ Ä%Ɏô.    L.ݯ
0010: 0A B3 EC B3 3D FC 60 E6  58 BA 20 49 0E 88 3D 38 : .³ì³=ü`æXº I..=8
0020: 4A 4B 4E 71                                      : JKNq
[libssh2] 0.800743 Conn: Closing channel 0/1000
=> libssh2_transport_write plain (5 bytes)
0000: 61 00 00 03 E8                                   : a...è
[libssh2] 0.800743 Socket: Sent 36/36 bytes at 0x1e94710
=> libssh2_transport_write send() (36 bytes)
0000: C8 ED D1 45 13 F0 BA 98  28 BA A8 BF FC 42 C6 A3 : ÈíÑE.ðº.(ºš¿üBÆ£
0010: 36 71 43 5D A5 99 40 9F  EB FB B5 A7 EE E3 79 CF : 6qc]...@Ÿëûµ§îãyÏ
0020: A8 10 B9 57                                      : š.¹W
[libssh2] 0.800743 Socket: Error recving 16384 bytes to 0x1f01948+0: 11
[libssh2] 1.019500 Socket: Recved 36/16384 bytes to 0x1f01948+0
=> libssh2_transport_read() raw (36 bytes)
0000: 4D C7 85 C1 54 31 04 F9  04 C8 84 A0 00 3E 74 DA : MDžÁT1.ù.Ȅ .>tÚ
0010: B4 93 74 4A 5F 74 46 35  28 F1 36 56 8E DE 61 34 : Ž“tJ_tF5(ñ6VŽÞa4
0020: E5 BD 61 37                                      : åœa7
=> libssh2_transport_read() plain (5 bytes)
0000: 61 00 00 00 00                                   : a....
[libssh2] 1.019500 Transport: Packet type 97 received, length=5
[libssh2] 1.019500 Conn: Close received for channel 0/1000
[libssh2] 1.019500 Transport: Looking for packet of type: 94
[libssh2] 1.019500 Transport: Looking for packet of type: 95
[libssh2] 1.019500 Transport: Freeing session resource
17:18:00:E: SFTP: opening remote file Q:\prj\temp\flt.sql failed, error = -31 
LIBSSH2_ERROR_SFTP_PROTOCOL Failed opening remote file
17:18:00:E: SFTP: sftp error = 3 SSH_FX_PERMISSION_DENIED
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to