Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Date: Fri, 06 Apr 2001 11:05:00 +0200
From: Ronald Hecht <ronald.hecht@gmx.de>
Subject: Re: sftp
To: Corinna Vinschen <cygwin@cygwin.com>
Reply-to: ronald.hecht@gmx.de
Message-id: <3ACD86BC.E5B7794D@gmx.de>
MIME-version: 1.0
X-Mailer: Mozilla 4.75 [de] (WinNT; U)
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7bit
X-Accept-Language: de
References: <3ACB5353.E8C8F77B@gmx.de>
 <20010405105016.M956@cygbert.vinschen.de> <3ACC5F40.D064F813@gmx.de>
 <20010405170141.C4845@cygbert.vinschen.de> <3ACC9849.C40549C2@gmx.de>
 <20010405180557.P956@cygbert.vinschen.de> <3ACCA55C.6CD52904@gmx.de>
 <20010406083740.Z956@cygbert.vinschen.de>



Corinna Vinschen schrieb:
> 
> On Thu, Apr 05, 2001 at 07:03:24PM +0200, Ronald Hecht wrote:
> > I'm debugging ..., but wondering why the process_readdir is called
> > twice. Do you have the same thing? Do you get a second SSH2_FXP_READDIR
> > like me? (using -v -v -v Option)
> 
> Yes:
> 
> sftp> ls
> debug3: Sending SSH2_FXP_READDIR I:3
> debug3: Received reply T:104 I:3
> debug3: Received 52 SSH2_FXP_NAME responses
> [...]
> debug3: Sending SSH2_FXP_READDIR I:4
> debug3: Received reply T:101 I:4
> debug3: Received SSH2_FXP_STATUS 1
> debug3: Sent message SSH2_FXP_CLOSE I:5
> debug3: SSH2_FXP_STATUS 0
> sftp>
> 

I tracked down the problem to the "(dp = readdir(dirp)) != NULL)"
command in process_readdir of sftp-server.c. The readdir function seems
to crash when it's called the second time. The main difference between
the first time it's called and the second is the value of
dirp->__d_dirent.__d_position. At the first time it's zero. The second
time nonzero (actually the last position of the directory). I set it to
zero, to see what happens and readdir is working correctly (lists the
directory again).

Hope, this helps a bit.

> Corinna
> 
> --
> Corinna Vinschen                  Please, send mails regarding Cygwin to
> Cygwin Developer                                mailto:cygwin@cygwin.com
> Red Hat, Inc.
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

