* RE: SFTP server when / is c:\
@ 2001-07-24 11:50 Mark Bradshaw
2001-07-24 12:45 ` Corinna Vinschen
0 siblings, 1 reply; 14+ messages in thread
From: Mark Bradshaw @ 2001-07-24 11:50 UTC (permalink / raw)
To: 'Corinna Vinschen'
I've done the patches. I'll polish 'em up and send them to you. It
comprises one patch to the client, and one patch to the server. All-in-all,
less than I anticipated.
Mark
-----Original Message-----
From: Corinna Vinschen [ mailto:cygwin@cygwin.com ]
Sent: Tuesday, July 24, 2001 2:27 PM
To: 'cygwin@cygwin.com'
Subject: Re: SFTP server when / is c:\
On Tue, Jul 24, 2001 at 12:44:08PM -0400, Mark Bradshaw wrote:
> SFTP server has some unfortunate logic that occurs when you try to ls,
get,
> or put things in root (/). It's got logic all over the place that creates
> paths that start with "//". Cygwin doesn't like to deal with these kind
of
> paths. <grin> This causes ls, get, and put (at least) to not work in /.
>
> When you do an ls (for example) sftp server creates pathnames to pass
back.
> It does this by combining the path + "/" + filename. This works great as
> long as the path doesn't includes a final /, which it normally doesn't.
> However, when you switch to / the path is / (obviously). The ls would
then
> end up coming back with things like //., //.., //cygwin.bat, etc.
>
> Seems that unix machines deal with these double slash paths, but cygwin
> doesn't? Am I on track here. Either way, I'm wondering which direction
is
> the best to attempt a patch with. Patch sftp-server.c in lots of spots,
or
> cygwin in (?) spots?
Patching sftp-server even if that will result in some... resistance
by the maintainers is appropriate.
Cygwin has to deal with // paths (//server/share/...) and we can't
change that.
If you're able to create a clean and neat patch I will try to
convince the maintainers of openssh.
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/
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 11:50 SFTP server when / is c:\ Mark Bradshaw
@ 2001-07-24 12:45 ` Corinna Vinschen
0 siblings, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2001-07-24 12:45 UTC (permalink / raw)
To: 'Corinna Vinschen'
On Tue, Jul 24, 2001 at 02:50:14PM -0400, Mark Bradshaw wrote:
> I've done the patches. I'll polish 'em up and send them to you. It
> comprises one patch to the client, and one patch to the server. All-in-all,
> less than I anticipated.
I'm looking forward.
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-25 4:24 Mark Bradshaw
@ 2001-07-25 7:15 ` Corinna Vinschen
0 siblings, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2001-07-25 7:15 UTC (permalink / raw)
To: cygwin
On Wed, Jul 25, 2001 at 07:24:41AM -0400, Mark Bradshaw wrote:
> Mhm. I like your version better! Thanks for patching my patch. <grin>
>
> I really appreciate all the work you do to make openssh (and others) run
> smoothly in cygwin. Here's a cyber pat on the back.
Oh thanks, I'm cyber glad ;-)
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: SFTP server when / is c:\
@ 2001-07-25 4:24 Mark Bradshaw
2001-07-25 7:15 ` Corinna Vinschen
0 siblings, 1 reply; 14+ messages in thread
From: Mark Bradshaw @ 2001-07-25 4:24 UTC (permalink / raw)
To: 'Corinna Vinschen'
Mhm. I like your version better! Thanks for patching my patch. <grin>
I really appreciate all the work you do to make openssh (and others) run
smoothly in cygwin. Here's a cyber pat on the back.
Mark
-----Original Message-----
From: Corinna Vinschen [ mailto:cygwin@cygwin.com ]
Sent: Wednesday, July 25, 2001 5:22 AM
To: cygwin
Subject: Re: SFTP server when / is c:\
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/
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 13:44 Mark Bradshaw
2001-07-24 14:59 ` Corinna Vinschen
@ 2001-07-25 2:22 ` Corinna Vinschen
1 sibling, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2001-07-25 2:22 UTC (permalink / raw)
To: cygwin
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 13:44 Mark Bradshaw
@ 2001-07-24 14:59 ` Corinna Vinschen
2001-07-25 2:22 ` Corinna Vinschen
1 sibling, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2001-07-24 14:59 UTC (permalink / raw)
To: cygwin
On Tue, Jul 24, 2001 at 04:44:44PM -0400, Mark Bradshaw wrote:
> Sure thing. Here's the update diffs.
Thanks, I will look into this probably tomorrow,
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: SFTP server when / is c:\
@ 2001-07-24 13:44 Mark Bradshaw
2001-07-24 14:59 ` Corinna Vinschen
2001-07-25 2:22 ` Corinna Vinschen
0 siblings, 2 replies; 14+ messages in thread
From: Mark Bradshaw @ 2001-07-24 13:44 UTC (permalink / raw)
To: 'Corinna Vinschen'
Sure thing. Here's the update diffs.
Mark
--------------------------------
--- /usr/src/openssh-2.9p2-2/sftp-server.c Fri Apr 13 10:28:42 2001
+++ /sftp-server.c Tue Jul 24 16:38:12 2001
@@ -753,6 +753,8 @@ process_readdir(void)
stats = xrealloc(stats, nstats *
sizeof(Stat));
}
/* XXX OVERFLOW ? */
+ if ( strcmp(path, "/") ==0 )
+ path[0] = 0;
snprintf(pathname, sizeof pathname,
"%s/%s", path, dp->d_name);
if (lstat(pathname, &st) < 0)
---------------------------------
--- /usr/src/openssh-2.9p2-2/sftp-int.c Tue May 8 20:39:19 2001
+++ /tmp/openssh-2.9p2/sftp-int.c Tue Jul 24 16:43:34 2001
@@ -204,7 +204,8 @@ path_append(char *p1, char *p2)
ret = xmalloc(len);
strlcpy(ret, p1, len);
- strlcat(ret, "/", len);
+ if ( strcmp(p1,"/") != 0 )
+ strlcat(ret, "/", len);
strlcat(ret, p2, len);
return(ret);
---------------------------------
-----Original Message-----
From: Corinna Vinschen [ mailto:cygwin@cygwin.com ]
Sent: Tuesday, July 24, 2001 4:31 PM
To: cygwin
Subject: Re: SFTP server when / is c:\
On Tue, Jul 24, 2001 at 03:44:19PM -0400, Mark Bradshaw wrote:
> I appreciate you taking a look at this. I didn't want to start throwing
> stuff onto the openssh developers list without having you give it the
> once-over.
A minor knit. The layout doesn't conform to the used convention.
Could you correct that?
> + if ( strcmp(p1,"/") != 0 ) strlcat(ret, "/", len);
Better
> + if ( strcmp(p1,"/") != 0 )
> + strlcat(ret, "/", len);
and
> + if ( strcmp(path, "/") ==0 ) path[0] = 0;
ditto
> + if ( strcmp(path, "/") ==0 )
> + path[0] = 0;
I will advocate that patch in openssh-unix-dev then.
And probably release an openssh-2.9p2-3 for Cygwin.
Thanks,
Corinna
--
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/
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 12:44 Mark Bradshaw
@ 2001-07-24 13:30 ` Corinna Vinschen
0 siblings, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2001-07-24 13:30 UTC (permalink / raw)
To: cygwin
On Tue, Jul 24, 2001 at 03:44:19PM -0400, Mark Bradshaw wrote:
> I appreciate you taking a look at this. I didn't want to start throwing
> stuff onto the openssh developers list without having you give it the
> once-over.
A minor knit. The layout doesn't conform to the used convention.
Could you correct that?
> + if ( strcmp(p1,"/") != 0 ) strlcat(ret, "/", len);
Better
> + if ( strcmp(p1,"/") != 0 )
> + strlcat(ret, "/", len);
and
> + if ( strcmp(path, "/") ==0 ) path[0] = 0;
ditto
> + if ( strcmp(path, "/") ==0 )
> + path[0] = 0;
I will advocate that patch in openssh-unix-dev then.
And probably release an openssh-2.9p2-3 for Cygwin.
Thanks,
Corinna
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: SFTP server when / is c:\
@ 2001-07-24 12:44 Mark Bradshaw
2001-07-24 13:30 ` Corinna Vinschen
0 siblings, 1 reply; 14+ messages in thread
From: Mark Bradshaw @ 2001-07-24 12:44 UTC (permalink / raw)
To: 'Corinna Vinschen'
Corinna,
Here's the patches needed to deal with the sftp double slash path
problem. As I mentioned before it only comprised one change on the server
side, and one change on the client side. I was able to do both with one
line changes, and the logic is simple so I think it's got a decent chance of
passing muster. The diffs following are against the 2.9p2 source, not the
latest openssh cvs snapshot. If you'd like I can make new diff's against
the latest source. I wasn't sure which you'd want.
The change to the client side happens in sftp-int.c. This patch corrects
the functioning of get and put when in the root directory. I made a change
to the path_append function. This is where the double slash is originating.
I added a check that determines if the path is equal to "/". If it's not
then the result of the function is path + "/" + file. Otherwise it's just
path + file.
The server side patch happens in sftp-server.c, and corrects the function of
ls and dir in the root directory. The change is in the process_readdir
function. It determines if the path is equal to "/". If it is it empties
path out. Then when the lines below it create a path by doing path + "/" +
filename it only uses one forward slash.
There were other ways to do the patch, but I wanted to keep it as
lightweight as possible. Both patches only affect operations when in root.
I think the changes are good for openssh in general since the existing logic
is (IMO) incorrect. Neither piece of code has been patched in the latest
OpenSSH cvs source code.
I appreciate you taking a look at this. I didn't want to start throwing
stuff onto the openssh developers list without having you give it the
once-over.
Mark
-------------------------
--- /usr/src/openssh-2.9p2-2/sftp-int.c Tue May 8 20:39:19 2001
+++ /tmp/openssh-2.9p2/sftp-int.c Tue Jul 24 15:00:08 2001
@@ -204,7 +204,7 @@ path_append(char *p1, char *p2)
ret = xmalloc(len);
strlcpy(ret, p1, len);
- strlcat(ret, "/", len);
+ if ( strcmp(p1,"/") != 0 ) strlcat(ret, "/", len);
strlcat(ret, p2, len);
return(ret);
--------------------------
--- /sftp-server.c Tue Jul 24 15:14:17 2001
+++ /usr/src/openssh-2.9p2-2/sftp-server.c Fri Apr 13 10:28:42 2001
@@ -753,7 +753,6 @@ process_readdir(void)
stats = xrealloc(stats, nstats *
sizeof(Stat));
}
/* XXX OVERFLOW ? */
+ if ( strcmp(path, "/") ==0 ) path[0] = 0;
snprintf(pathname, sizeof pathname,
"%s/%s", path, dp->d_name);
if (lstat(pathname, &st) < 0)
--------------------------
-----Original Message-----
From: Corinna Vinschen [ mailto:cygwin@cygwin.com ]
Sent: Tuesday, July 24, 2001 2:27 PM
To: 'cygwin@cygwin.com'
Subject: Re: SFTP server when / is c:\
On Tue, Jul 24, 2001 at 12:44:08PM -0400, Mark Bradshaw wrote:
> SFTP server has some unfortunate logic that occurs when you try to ls,
get,
> or put things in root (/). It's got logic all over the place that creates
> paths that start with "//". Cygwin doesn't like to deal with these kind
of
> paths. <grin> This causes ls, get, and put (at least) to not work in /.
>
> When you do an ls (for example) sftp server creates pathnames to pass
back.
> It does this by combining the path + "/" + filename. This works great as
> long as the path doesn't includes a final /, which it normally doesn't.
> However, when you switch to / the path is / (obviously). The ls would
then
> end up coming back with things like //., //.., //cygwin.bat, etc.
>
> Seems that unix machines deal with these double slash paths, but cygwin
> doesn't? Am I on track here. Either way, I'm wondering which direction
is
> the best to attempt a patch with. Patch sftp-server.c in lots of spots,
or
> cygwin in (?) spots?
Patching sftp-server even if that will result in some... resistance
by the maintainers is appropriate.
Cygwin has to deal with // paths (//server/share/...) and we can't
change that.
If you're able to create a clean and neat patch I will try to
convince the maintainers of openssh.
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/
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: SFTP server when / is c:\
@ 2001-07-24 11:50 Mark Bradshaw
0 siblings, 0 replies; 14+ messages in thread
From: Mark Bradshaw @ 2001-07-24 11:50 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
crystal
-----Original Message-----
From: Christopher Faylor [ mailto:cgf@redhat.com ]
Sent: Tuesday, July 24, 2001 1:46 PM
To: cygwin@cygwin.com
Subject: Re: SFTP server when / is c:\
On Tue, Jul 24, 2001 at 12:51:53PM -0400, Larry Hall (RFK Partners, Inc)
wrote:
>At 12:44 PM 7/24/2001, Mark Bradshaw wrote:
>>SFTP server has some unfortunate logic that occurs when you try to ls,
get,
>>or put things in root (/). It's got logic all over the place that creates
>>paths that start with "//". Cygwin doesn't like to deal with these kind
of
>>paths. <grin> This causes ls, get, and put (at least) to not work in /.
>>
>>When you do an ls (for example) sftp server creates pathnames to pass
back.
>>It does this by combining the path + "/" + filename. This works great as
>>long as the path doesn't includes a final /, which it normally doesn't.
>>However, when you switch to / the path is / (obviously). The ls would
then
>>end up coming back with things like //., //.., //cygwin.bat, etc.
>>
>>Seems that unix machines deal with these double slash paths, but cygwin
>>doesn't? Am I on track here. Either way, I'm wondering which direction
is
>>the best to attempt a patch with. Patch sftp-server.c in lots of spots,
or
>>cygwin in (?) spots?
>
>An argument could be made either way but I would suggest that its best to
>make SFTP as portable as possible. In that context, patching SFTP is
>best.
I don't see any argument for patching cygwin. A '//' means something
special to cygwin, it is allowed to mean something special, and cygwin
is not the only system that interprets '//' as special.
I don't see how you could possibly patch cygwin to deal with this.
Obviously
you can't do something like "Does //foo exist? Yes. Ok, I'll use that
rather
than use the //foo share." Or, I hope it is obvious why this logic is
flawed.
cgf
--
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/
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 9:44 Mark Bradshaw
2001-07-24 9:52 ` Larry Hall (RFK Partners, Inc)
@ 2001-07-24 11:27 ` Corinna Vinschen
1 sibling, 0 replies; 14+ messages in thread
From: Corinna Vinschen @ 2001-07-24 11:27 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
On Tue, Jul 24, 2001 at 12:44:08PM -0400, Mark Bradshaw wrote:
> SFTP server has some unfortunate logic that occurs when you try to ls, get,
> or put things in root (/). It's got logic all over the place that creates
> paths that start with "//". Cygwin doesn't like to deal with these kind of
> paths. <grin> This causes ls, get, and put (at least) to not work in /.
>
> When you do an ls (for example) sftp server creates pathnames to pass back.
> It does this by combining the path + "/" + filename. This works great as
> long as the path doesn't includes a final /, which it normally doesn't.
> However, when you switch to / the path is / (obviously). The ls would then
> end up coming back with things like //., //.., //cygwin.bat, etc.
>
> Seems that unix machines deal with these double slash paths, but cygwin
> doesn't? Am I on track here. Either way, I'm wondering which direction is
> the best to attempt a patch with. Patch sftp-server.c in lots of spots, or
> cygwin in (?) spots?
Patching sftp-server even if that will result in some... resistance
by the maintainers is appropriate.
Cygwin has to deal with // paths (//server/share/...) and we can't
change that.
If you're able to create a clean and neat patch I will try to
convince the maintainers of openssh.
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 9:52 ` Larry Hall (RFK Partners, Inc)
@ 2001-07-24 10:45 ` Christopher Faylor
0 siblings, 0 replies; 14+ messages in thread
From: Christopher Faylor @ 2001-07-24 10:45 UTC (permalink / raw)
To: cygwin
On Tue, Jul 24, 2001 at 12:51:53PM -0400, Larry Hall (RFK Partners, Inc) wrote:
>At 12:44 PM 7/24/2001, Mark Bradshaw wrote:
>>SFTP server has some unfortunate logic that occurs when you try to ls, get,
>>or put things in root (/). It's got logic all over the place that creates
>>paths that start with "//". Cygwin doesn't like to deal with these kind of
>>paths. <grin> This causes ls, get, and put (at least) to not work in /.
>>
>>When you do an ls (for example) sftp server creates pathnames to pass back.
>>It does this by combining the path + "/" + filename. This works great as
>>long as the path doesn't includes a final /, which it normally doesn't.
>>However, when you switch to / the path is / (obviously). The ls would then
>>end up coming back with things like //., //.., //cygwin.bat, etc.
>>
>>Seems that unix machines deal with these double slash paths, but cygwin
>>doesn't? Am I on track here. Either way, I'm wondering which direction is
>>the best to attempt a patch with. Patch sftp-server.c in lots of spots, or
>>cygwin in (?) spots?
>
>An argument could be made either way but I would suggest that its best to
>make SFTP as portable as possible. In that context, patching SFTP is
>best.
I don't see any argument for patching cygwin. A '//' means something
special to cygwin, it is allowed to mean something special, and cygwin
is not the only system that interprets '//' as special.
I don't see how you could possibly patch cygwin to deal with this. Obviously
you can't do something like "Does //foo exist? Yes. Ok, I'll use that rather
than use the //foo share." Or, I hope it is obvious why this logic is flawed.
cgf
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: SFTP server when / is c:\
2001-07-24 9:44 Mark Bradshaw
@ 2001-07-24 9:52 ` Larry Hall (RFK Partners, Inc)
2001-07-24 10:45 ` Christopher Faylor
2001-07-24 11:27 ` Corinna Vinschen
1 sibling, 1 reply; 14+ messages in thread
From: Larry Hall (RFK Partners, Inc) @ 2001-07-24 9:52 UTC (permalink / raw)
To: Mark Bradshaw, 'cygwin@cygwin.com'
At 12:44 PM 7/24/2001, Mark Bradshaw wrote:
>SFTP server has some unfortunate logic that occurs when you try to ls, get,
>or put things in root (/). It's got logic all over the place that creates
>paths that start with "//". Cygwin doesn't like to deal with these kind of
>paths. <grin> This causes ls, get, and put (at least) to not work in /.
>
>When you do an ls (for example) sftp server creates pathnames to pass back.
>It does this by combining the path + "/" + filename. This works great as
>long as the path doesn't includes a final /, which it normally doesn't.
>However, when you switch to / the path is / (obviously). The ls would then
>end up coming back with things like //., //.., //cygwin.bat, etc.
>
>Seems that unix machines deal with these double slash paths, but cygwin
>doesn't? Am I on track here. Either way, I'm wondering which direction is
>the best to attempt a patch with. Patch sftp-server.c in lots of spots, or
>cygwin in (?) spots?
>
>Mark
An argument could be made either way but I would suggest that its best to
make SFTP as portable as possible. In that context, patching SFTP is
best.
Larry Hall lhall@rfk.com
RFK Partners, Inc. http://www.rfk.com
118 Washington Street (508) 893-9779 - RFK Office
Holliston, MA 01746 (508) 893-9889 - FAX
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
* SFTP server when / is c:\
@ 2001-07-24 9:44 Mark Bradshaw
2001-07-24 9:52 ` Larry Hall (RFK Partners, Inc)
2001-07-24 11:27 ` Corinna Vinschen
0 siblings, 2 replies; 14+ messages in thread
From: Mark Bradshaw @ 2001-07-24 9:44 UTC (permalink / raw)
To: 'cygwin@cygwin.com'
SFTP server has some unfortunate logic that occurs when you try to ls, get,
or put things in root (/). It's got logic all over the place that creates
paths that start with "//". Cygwin doesn't like to deal with these kind of
paths. <grin> This causes ls, get, and put (at least) to not work in /.
When you do an ls (for example) sftp server creates pathnames to pass back.
It does this by combining the path + "/" + filename. This works great as
long as the path doesn't includes a final /, which it normally doesn't.
However, when you switch to / the path is / (obviously). The ls would then
end up coming back with things like //., //.., //cygwin.bat, etc.
Seems that unix machines deal with these double slash paths, but cygwin
doesn't? Am I on track here. Either way, I'm wondering which direction is
the best to attempt a patch with. Patch sftp-server.c in lots of spots, or
cygwin in (?) spots?
Mark
--
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/
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2001-07-25 7:15 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-24 11:50 SFTP server when / is c:\ Mark Bradshaw
2001-07-24 12:45 ` Corinna Vinschen
-- strict thread matches above, loose matches on Subject: below --
2001-07-25 4:24 Mark Bradshaw
2001-07-25 7:15 ` Corinna Vinschen
2001-07-24 13:44 Mark Bradshaw
2001-07-24 14:59 ` Corinna Vinschen
2001-07-25 2:22 ` Corinna Vinschen
2001-07-24 12:44 Mark Bradshaw
2001-07-24 13:30 ` Corinna Vinschen
2001-07-24 11:50 Mark Bradshaw
2001-07-24 9:44 Mark Bradshaw
2001-07-24 9:52 ` Larry Hall (RFK Partners, Inc)
2001-07-24 10:45 ` Christopher Faylor
2001-07-24 11:27 ` Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).