=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/cmds.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- src/usr.bin/ftp/cmds.c 1999/06/29 14:33:23 1.31 +++ src/usr.bin/ftp/cmds.c 1999/12/08 12:57:06 1.32 @@ -1,7 +1,36 @@ -/* $OpenBSD: cmds.c,v 1.31 1999/06/29 14:33:23 aaron Exp $ */ +/* $OpenBSD: cmds.c,v 1.32 1999/12/08 12:57:06 itojun Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* + * Copyright (C) 1997 and 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* * Copyright (c) 1985, 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * @@ -38,7 +67,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else -static char rcsid[] = "$OpenBSD: cmds.c,v 1.31 1999/06/29 14:33:23 aaron Exp $"; +static char rcsid[] = "$OpenBSD: cmds.c,v 1.32 1999/12/08 12:57:06 itojun Exp $"; #endif #endif /* not lint */ @@ -653,8 +682,8 @@ } pswitch(0); } - fprintf(ttyout, "Gate ftp: %s, server %s, port %d.\n", onoff(gatemode), - *gateserver ? gateserver : "(none)", ntohs(gateport)); + fprintf(ttyout, "Gate ftp: %s, server %s, port %s.\n", onoff(gatemode), + *gateserver ? gateserver : "(none)", gateport); fprintf(ttyout, "Passive mode: %s.\n", onoff(passivemode)); fprintf(ttyout, "Mode: %s; Type: %s; Form: %s; Structure: %s.\n", modename, typename, formname, structname); @@ -679,7 +708,7 @@ } fprintf(ttyout, "Hash mark printing: %s; Mark count: %d; Progress bar: %s.\n", onoff(hash), mark, onoff(progress)); - fprintf(ttyout, "Use of PORT cmds: %s.\n", onoff(sendport)); + fprintf(ttyout, "Use of PORT/LPRT cmds: %s.\n", onoff(sendport)); #ifndef SMALL fprintf(ttyout, "Command line editing: %s.\n", onoff(editing)); #endif /* !SMALL */ @@ -812,7 +841,7 @@ } /* - * Toggle PORT cmd use before each data connection. + * Toggle PORT/LPRT cmd use before each data connection. */ /*VARARGS*/ void @@ -821,7 +850,7 @@ char *argv[]; { - code = togglevar(argc, argv, &sendport, "Use of PORT cmds"); + code = togglevar(argc, argv, &sendport, "Use of PORT/LPRT cmds"); } /* @@ -875,6 +904,7 @@ gatemode = 0; else { if (argc == 3) { +#if 0 char *ep; long port; @@ -887,6 +917,9 @@ return; } gateport = htons(port); +#else + gateport = strdup(argv[2]); +#endif } strncpy(gsbuf, argv[1], sizeof(gsbuf) - 1); gsbuf[sizeof(gsbuf) - 1] = '\0'; @@ -899,9 +932,9 @@ "Disabling gate-ftp mode - no gate-ftp server defined.\n"); gatemode = 0; } else { - fprintf(ttyout, "Gate ftp: %s, server %s, port %d.\n", + fprintf(ttyout, "Gate ftp: %s, server %s, port %s.\n", onoff(gatemode), - *gateserver ? gateserver : "(none)", ntohs(gateport)); + *gateserver ? gateserver : "(none)", gateport); } code = gatemode; }