Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

user/3051: ftp(1) has problems with directories not existing under certain circumstances

From: Sam Smith <s(at)msmith.net>
Date: Fri Dec 27 2002 - 07:59:51 EST


>Number: 3051
>Category: user
>Synopsis: ftp(1) has problems with directories not existing under certain circumstances
>Confidential: no
        

	System      : OpenBSD 3.2
	Architecture: OpenBSD.i386
	Machine     : i386

>Description:

When using the
  ftp ftp://[user:password@]host[:port]/file[/] form of ftp, if the directory part of file does not exist, this is ignored rather than being treated as an error.

>How-To-Repeat:

 $ ftp -v -n ftp://username:password@your.host/does/not/exist/bsd you will try to download the file /bsd from your.host (if there is a /bsd file).

Example; the install media. Because if you gave the path to the install sets in the installer as a relative path, you can get a directory listing (got in a different way), but you can not actually get any of the files it lists. It may however find the bsd "set" in the / of the ftp server.

>Fix:

This may need to be extended a bit to cope with other failure types.

Index: cmds.c



RCS file: /cvs/src/usr.bin/ftp/cmds.c,v
retrieving revision 1.41
diff -u -r1.41 cmds.c
--- cmds.c      12 Jul 2002 00:25:30 -0000      1.41
+++ cmds.c      27 Dec 2002 12:43:55 -0000
@@ -1045,6 +1045,10 @@
                        fputs("CWD command not recognized, trying XCWD.\n", ttyout);
                r = command("XCWD %s", argv[1]);
        }
+       if (r == ERROR && code == 550) {
+               dirchange=0;
+               return;
+       }
        if (r == COMPLETE)
                dirchange = 1;

 }
Do you need help?X

>Release-Note:
Received on Mon Dec 30 08:43:02 2002

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:43 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library