Error getting to /cygdrive

Advertisement

bluedrops
Guest

Error getting to /cygdrive

Hi,

I connect the Win2k PC (openssh 3.7.1p1-1 Installer Build 20030930) with WinSCP 3.3 in sftp mode. WinSCP lists my /cygdrive/d home directry. If I go to /cygdrive/c then try to go back to /cygdrive, I get the message at the end of the log. I have to restart the session to be able to go to /cygdrive (note that I can still go to other drives with CTRL-O -> /cygdrive/d)
Only drive c has this problem. PSFTP works fine so I think this is just related to WinSCP.

Thanks for your help,

Laurent

. Listing directory "/cygdrive/d".
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 523
< Type: SSH_FXP_HANDLE, Size: 13, Number: 523
> Type: SSH_FXP_READDIR, Size: 13, Number: 780
< Type: SSH_FXP_NAME, Size: 2122, Number: 780
> Type: SSH_FXP_READDIR, Size: 13, Number: 1036
< Type: SSH_FXP_STATUS, Size: 28, Number: 1036
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 1284
< Type: SSH_FXP_STATUS, Size: 24, Number: 1284
< Status/error code: 0
. Startup conversation with host finished.
. Changing directory to "..".
> Type: SSH_FXP_REALPATH, Size: 23, Number: 1552
< Type: SSH_FXP_NAME, Size: 39, Number: 1552
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 1803
< Type: SSH_FXP_HANDLE, Size: 13, Number: 1803
> Type: SSH_FXP_CLOSE, Size: 13, Number: 2052
< Type: SSH_FXP_STATUS, Size: 24, Number: 2052
< Status/error code: 0
. Getting current directory name.
. Listing directory "/cygdrive".
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 2315
< Type: SSH_FXP_HANDLE, Size: 13, Number: 2315
> Type: SSH_FXP_READDIR, Size: 13, Number: 2572
< Type: SSH_FXP_NAME, Size: 523, Number: 2572
> Type: SSH_FXP_READDIR, Size: 13, Number: 2828
< Type: SSH_FXP_STATUS, Size: 28, Number: 2828
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 3076
< Type: SSH_FXP_STATUS, Size: 24, Number: 3076
< Status/error code: 0
. Changing directory to "c".
> Type: SSH_FXP_REALPATH, Size: 20, Number: 3344
< Type: SSH_FXP_NAME, Size: 43, Number: 3344
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 3595
< Type: SSH_FXP_HANDLE, Size: 13, Number: 3595
> Type: SSH_FXP_CLOSE, Size: 13, Number: 3844
< Type: SSH_FXP_STATUS, Size: 24, Number: 3844
< Status/error code: 0
. Getting current directory name.
. Listing directory "/cygdrive/c".
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 4107
< Type: SSH_FXP_HANDLE, Size: 13, Number: 4107
> Type: SSH_FXP_READDIR, Size: 13, Number: 4364
< Type: SSH_FXP_NAME, Size: 3452, Number: 4364
> Type: SSH_FXP_READDIR, Size: 13, Number: 4620
< Type: SSH_FXP_STATUS, Size: 28, Number: 4620
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 4868
< Type: SSH_FXP_STATUS, Size: 24, Number: 4868
< Status/error code: 0
. Changing directory to "..".
> Type: SSH_FXP_REALPATH, Size: 23, Number: 5136
< Type: SSH_FXP_NAME, Size: 39, Number: 5136
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 5387
< Type: SSH_FXP_HANDLE, Size: 13, Number: 5387
> Type: SSH_FXP_CLOSE, Size: 13, Number: 5636
< Type: SSH_FXP_STATUS, Size: 34, Number: 5636
< Status/error code: 3, Message: 5636, Server: Permission denied, Language: ?
* (ECommand) Error changing directory to "..".
* Permission denied.
* Error code: 3
* Error message from server: Permission denied (?)
* Request code: 4
. Closing connection.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Error getting to /cygdrive

Thanks for the info. From the log I'm not able to find out why this happens. I'll improve the logging in next release and than I'll ask you to send me a log again.

Can you meanwhile this with PSFTP?
cd /cygdrive/d
cd ..
cd c
cd ..
ls
Thanks.

Reply with quote

bluedrops
Guest

Re: Error getting to /cygdrive

martin wrote:

Thanks for the info. From the log I'm not able to find out why this happens. I'll improve the logging in next release and than I'll ask you to send me a log again.

Can you meanwhile this with PSFTP?
cd /cygdrive/d
cd ..
cd c
cd ..
ls
Thanks.

No problem doing this with PSFTP

Thanks for your reply

Reply with quote

bluedrops
Guest

Re: Error getting to /cygdrive

martin wrote:

Please try it with WinSCP 3.3.1 beta #185 and send me a log file. Thanks.

Here is the log. I tryed another SFTP client (CuteFTP). It says "Insufficient privileges to perform the operation" but lists the directory.
So the problem seems to be related to OpenSSH.
Do you have any clue about that ?

Thanks,

Laurent

. Using SFTP protocol.
. Doing startup conversation with host.
> Type: SSH_FXP_INIT, Size: 5, Number: -1
< Type: SSH_FXP_VERSION, Size: 5, Number: -1
. SFTP version 3 negotiated.
> Type: SSH_FXP_EXTENDED, Size: 38, Number: 200
< Type: SSH_FXP_STATUS, Size: 38, Number: 200
< Status/error code: 8
. Server does not recognise WinSCP.
. Getting current directory name.
> Type: SSH_FXP_REALPATH, Size: 10, Number: 272
< Type: SSH_FXP_NAME, Size: 43, Number: 272
. Real path for '.' is '/cygdrive/d'
. Listing directory "/cygdrive/d".
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 523
< Type: SSH_FXP_HANDLE, Size: 13, Number: 523
> Type: SSH_FXP_READDIR, Size: 13, Number: 780
< Type: SSH_FXP_NAME, Size: 2122, Number: 780
> Type: SSH_FXP_READDIR, Size: 13, Number: 1036
< Type: SSH_FXP_STATUS, Size: 28, Number: 1036
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 1284
< Type: SSH_FXP_STATUS, Size: 24, Number: 1284
< Status/error code: 0
. Startup conversation with host finished.
. Changing directory to "..".
> Type: SSH_FXP_REALPATH, Size: 23, Number: 1552
< Type: SSH_FXP_NAME, Size: 39, Number: 1552
. Real path for '/cygdrive/d/..' is '/cygdrive'
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 1803
< Type: SSH_FXP_HANDLE, Size: 13, Number: 1803
> Type: SSH_FXP_CLOSE, Size: 13, Number: 2052
< Type: SSH_FXP_STATUS, Size: 24, Number: 2052
< Status/error code: 0
. Getting current directory name.
. Listing directory "/cygdrive".
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 2315
< Type: SSH_FXP_HANDLE, Size: 13, Number: 2315
> Type: SSH_FXP_READDIR, Size: 13, Number: 2572
< Type: SSH_FXP_NAME, Size: 1339, Number: 2572
> Type: SSH_FXP_READDIR, Size: 13, Number: 2828
< Type: SSH_FXP_STATUS, Size: 28, Number: 2828
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 3076
< Type: SSH_FXP_STATUS, Size: 24, Number: 3076
< Status/error code: 0
. Changing directory to "c".
> Type: SSH_FXP_REALPATH, Size: 20, Number: 3344
< Type: SSH_FXP_NAME, Size: 43, Number: 3344
. Real path for '/cygdrive/c' is '/cygdrive/c'
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 3595
< Type: SSH_FXP_HANDLE, Size: 13, Number: 3595
> Type: SSH_FXP_CLOSE, Size: 13, Number: 3844
< Type: SSH_FXP_STATUS, Size: 24, Number: 3844
< Status/error code: 0
. Getting current directory name.
. Listing directory "/cygdrive/c".
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 4107
< Type: SSH_FXP_HANDLE, Size: 13, Number: 4107
> Type: SSH_FXP_READDIR, Size: 13, Number: 4364
< Type: SSH_FXP_NAME, Size: 3452, Number: 4364
> Type: SSH_FXP_READDIR, Size: 13, Number: 4620
< Type: SSH_FXP_STATUS, Size: 28, Number: 4620
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 4868
< Type: SSH_FXP_STATUS, Size: 24, Number: 4868
< Status/error code: 0
. Changing directory to "..".
> Type: SSH_FXP_REALPATH, Size: 23, Number: 5136
< Type: SSH_FXP_NAME, Size: 39, Number: 5136
. Real path for '/cygdrive/c/..' is '/cygdrive'
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 5387
< Type: SSH_FXP_HANDLE, Size: 13, Number: 5387
> Type: SSH_FXP_CLOSE, Size: 13, Number: 5636
< Type: SSH_FXP_STATUS, Size: 34, Number: 5636
< Status/error code: 3, Message: 5636, Server: Permission denied, Language: ?
* (ECommand) Error changing directory to '..'.
* Permission denied.
* Error code: 3
* Error message from server: Permission denied (?)
* Request code: 4
. Closing connection.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Error getting to /cygdrive

I have some idea for workaround. If I have time this evening, I'll prepare test version for you.

One more question: at the end of the log I see "Closing connection". Was it closed by itself as reaction to error or did you close it? I hope that the latter case is true.

Reply with quote

bluedrops
Guest

Re: Error getting to /cygdrive

martin wrote:

I'm sorry that it took so long.
Can you try it with WinSCP version 3.3.1 build 188?

Hi,

Thanks, it works with this version. The "Closing connection" is because I closed it myself. Here is a debug output with this version of WinSCP. I made /cygdrive/d -> /cygdrive -> /cygdrive/c -> /cygdrive -> refresh on cygdrive.

What was the problem ?

Thanks,

Laurent

. Using SFTP protocol.
. Doing startup conversation with host.
> Type: SSH_FXP_INIT, Size: 5, Number: -1
< Type: SSH_FXP_VERSION, Size: 5, Number: -1
. SFTP version 3 negotiated.
> Type: SSH_FXP_EXTENDED, Size: 38, Number: 13768
< Type: SSH_FXP_STATUS, Size: 38, Number: 13768
< Status/error code: 8
. Server does not recognise WinSCP.
. Getting current directory name.
> Type: SSH_FXP_REALPATH, Size: 10, Number: 13840
< Type: SSH_FXP_NAME, Size: 43, Number: 13840
. Real path for '.' is '/cygdrive/d'
. Listing directory "/cygdrive/d".
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 14091
< Type: SSH_FXP_HANDLE, Size: 13, Number: 14091
> Type: SSH_FXP_READDIR, Size: 13, Number: 14348
< Type: SSH_FXP_NAME, Size: 2122, Number: 14348
> Type: SSH_FXP_READDIR, Size: 13, Number: 14604
< Type: SSH_FXP_STATUS, Size: 28, Number: 14604
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 14852
< Type: SSH_FXP_STATUS, Size: 24, Number: 14852
< Status/error code: 0
. Startup conversation with host finished.
. Changing directory to "..".
> Type: SSH_FXP_REALPATH, Size: 23, Number: 15120
< Type: SSH_FXP_NAME, Size: 39, Number: 15120
. Real path for '/cygdrive/d/..' is '/cygdrive'
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 15371
< Type: SSH_FXP_HANDLE, Size: 13, Number: 15371
> Type: SSH_FXP_CLOSE, Size: 13, Number: 15620
< Type: SSH_FXP_STATUS, Size: 24, Number: 15620
< Status/error code: 0
. Getting current directory name.
. Listing directory "/cygdrive".
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 15883
< Type: SSH_FXP_HANDLE, Size: 13, Number: 15883
> Type: SSH_FXP_READDIR, Size: 13, Number: 16140
< Type: SSH_FXP_NAME, Size: 1237, Number: 16140
> Type: SSH_FXP_READDIR, Size: 13, Number: 16396
< Type: SSH_FXP_STATUS, Size: 28, Number: 16396
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 16644
< Type: SSH_FXP_STATUS, Size: 24, Number: 16644
< Status/error code: 0
. Changing directory to "c".
> Type: SSH_FXP_REALPATH, Size: 20, Number: 16912
< Type: SSH_FXP_NAME, Size: 43, Number: 16912
. Real path for '/cygdrive/c' is '/cygdrive/c'
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 17163
< Type: SSH_FXP_HANDLE, Size: 13, Number: 17163
> Type: SSH_FXP_CLOSE, Size: 13, Number: 17412
< Type: SSH_FXP_STATUS, Size: 24, Number: 17412
< Status/error code: 0
. Getting current directory name.
. Listing directory "/cygdrive/c".
> Type: SSH_FXP_OPENDIR, Size: 20, Number: 17675
< Type: SSH_FXP_HANDLE, Size: 13, Number: 17675
> Type: SSH_FXP_READDIR, Size: 13, Number: 17932
< Type: SSH_FXP_NAME, Size: 3452, Number: 17932
> Type: SSH_FXP_READDIR, Size: 13, Number: 18188
< Type: SSH_FXP_STATUS, Size: 28, Number: 18188
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 18436
< Type: SSH_FXP_STATUS, Size: 24, Number: 18436
< Status/error code: 0
. Changing directory to "..".
> Type: SSH_FXP_REALPATH, Size: 23, Number: 18704
< Type: SSH_FXP_NAME, Size: 39, Number: 18704
. Real path for '/cygdrive/c/..' is '/cygdrive'
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 18955
< Type: SSH_FXP_HANDLE, Size: 13, Number: 18955
> Type: SSH_FXP_CLOSE, Size: 13, Number: 19204
< Type: SSH_FXP_STATUS, Size: 34, Number: 19204
< Status/error code: 3
. Getting current directory name.
. Directory content loaded from cache.
. Getting current directory name.
. Listing directory "/cygdrive".
> Type: SSH_FXP_OPENDIR, Size: 18, Number: 19467
< Type: SSH_FXP_HANDLE, Size: 13, Number: 19467
> Type: SSH_FXP_READDIR, Size: 13, Number: 19724
< Type: SSH_FXP_NAME, Size: 1237, Number: 19724
> Type: SSH_FXP_READDIR, Size: 13, Number: 19980
< Type: SSH_FXP_STATUS, Size: 28, Number: 19980
< Status/error code: 1
> Type: SSH_FXP_CLOSE, Size: 13, Number: 20228
< Type: SSH_FXP_STATUS, Size: 34, Number: 20228
< Status/error code: 3
. Closing connection.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Error getting to /cygdrive

bluedrops wrote:

Thanks, it works with this version. The "Closing connection" is because I closed it myself. Here is a debug output with this version of WinSCP. I made /cygdrive/d -> /cygdrive -> /cygdrive/c -> /cygdrive -> refresh on cygdrive.

What was the problem ?
First something about SFTP: To get directory listing, client must with issue SSH_FXP_OPENDIR request. Than it should issue SSH_FXP_READDIR many times, until server sends all listing data. At the end client should send SSH_FXP_CLOSE to notify server, that it can free resources allocated for directory listing.

The server can send various error responses to SSH_FXP_OPENDIR and SSH_FXP_READDIR, including of course "Permission denied". However it is very unlikely that it responds "Permissions denied" to SSH_FXP_CLOSE. What can be denied, when the directory was already opened and read? But your server does it, see "Status/error code: 3" at the end of the log. Code 3 is permission denied. I have no idea, why it does it. I believe it is a bug, mainly because it happens only, when leaving /cydrive/c.

PSFTP works, because it ignores any error responses to SSH_FXP_CLOSE. WinSCP didn't. So I've changed it to ignore them too.

Reply with quote

Advertisement

You can post new topics in this forum