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: Wed, 25 Jul 2001 11:21:54 +0200
From: Corinna Vinschen <cygwin@cygwin.com>
To: cygwin <cygwin@cygwin.com>
Subject: Re: SFTP server when / is c:\
Message-ID: <20010725112154.C490@cygbert.vinschen.de>
Mail-Followup-To: cygwin <cygwin@cygwin.com>
References: <911C684A29ACD311921800508B7293BA010A8ACA@cnmail>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.2.5i
In-Reply-To: <911C684A29ACD311921800508B7293BA010A8ACA@cnmail>; from bradshaw@staff.crosswalk.com on Tue, Jul 24, 2001 at 04:44:44PM -0400

On Tue, Jul 24, 2001 at 04:44:44PM -0400, Mark Bradshaw wrote:
> Sure thing.  Here's the update diffs.

I have patched your patch slightly to be less intrusive. Your
patch to sftp-server.c changed the content of `path' which
has been given as parameter. I changed the call to snprintf
instead:

diff -u -p -r1.34 sftp-server.c
--- sftp-server.c	2001/07/04 03:32:33	1.34
+++ sftp-server.c	2001/07/25 08:44:31
@@ -756,8 +756,8 @@ process_readdir(void)
 				stats = xrealloc(stats, nstats * sizeof(Stat));
 			}
 /* XXX OVERFLOW ? */
-			snprintf(pathname, sizeof pathname,
-			    "%s/%s", path, dp->d_name);
+			snprintf(pathname, sizeof pathname, "%s%s%s", path,
+			    strcmp(path, "/") ? "/" : "", dp->d_name);
 			if (lstat(pathname, &st) < 0)
 				continue;
 			stat_to_attrib(&st, &(stats[count].attrib));

I have send the patch to the openssh-unix-dev mailing list a few
minutes ago. The Cygwin openssh-2.9p2-3 version containg your
patch is on sourceware already and will show up on the mirrors
at least tomorrow.

Thanks for tracking this down and especially for providing a patch!
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

