problem with sftp & huawei switches

Milan Kocian milon at wq.cz
Thu Nov 8 21:07:29 EST 2007


On Sun, Nov 04, 2007 at 09:49:55AM -0700, Darren Tucker wrote:
> [...]
> 
> Looks like your switch doesn't support the stat() operation, which
> sftp(1) uses before the download and will abort the download if the
> stat fails.
> 
> You can try this patch, which is against OpenBSD's -current but should
> apply to 4.7 and 4.6 as well (and yeah, I know "goto" is bad, this is
> the minimum change to test the theory.)
> 

Hello again,

I tried to look at this in more detail. And here is ugly patch that
works for me (in combination with yours).

Here is log from sesssion:

sftp> ls
sftp> ls *
aaa 				hw-http3.1.5-0043.web		hw-http3.1.5-0049.web                    
s5600-vrp310-r1510p06.bin	s5600-vrp310-r1510p12.bin	s5600_v408.btm                           
vrpcfg.cfg			vrpcfg.def                               
sftp> get vrpcfg.cfg
Fetching flash:/vrpcfg.cfg to vrpcfg.cfg
Couldn't stat remote file: Operation unsupported
flash:/vrpcfg.cfg
0% 2554     2.5KB/s 14948:06:54
sftp> 

So it seems to problem in glob. BTW. sftp client has a problem with names
that contain spaces.

--- openssh-4.3p2/openbsd-compat/glob.c	2005-11-10 07:02:22.000000000 +0100
+++ openssh-4.3p2.new/openbsd-compat/glob.c	2007-11-08 10:20:07.991115714 +0100
@@ -521,8 +521,8 @@
 	for (anymeta = 0;;) {
 		if (*pattern == EOS) {		/* End of pattern? */
 			*pathend = EOS;
-			if (g_lstat(pathbuf, &sb, pglob))
-				return(0);
+			//if (g_lstat(pathbuf, &sb, pglob))
+			//	return(0);
 
 			if (((pglob->gl_flags & GLOB_MARK) &&
 			    pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) ||


Regards,

-- 
Milan Kocian


More information about the openssh-unix-dev mailing list