NetBSD Problem Report #15451
Received: (qmail 19465 invoked from network); 1 Feb 2002 05:45:15 -0000
Message-Id: <20020201054458.76A487BA@starfruit.itojun.org>
Date: Fri, 1 Feb 2002 14:44:58 +0900 (JST)
From: itojun@itojun.org
Reply-To: itojun@itojun.org
To: gnats-bugs@gnats.netbsd.org
Subject: usr.bin/ftp macro behavior non-intuitive
X-Send-Pr-Version: 3.95
>Number: 15451
>Category: bin
>Synopsis: usr.bin/ftp macro behavior non-intuitive
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Feb 01 05:46:00 +0000 2002
>Closed-Date:
>Last-Modified: Sat Jun 16 07:22:55 +0000 2012
>Originator: Jun-ichiro itojun Hagino
>Release: NetBSD 1.5ZA
>Organization:
itojun.org
>Environment:
System: NetBSD starfruit.itojun.org 1.5ZA NetBSD 1.5ZA (STARFRUIT) #: Fri Feb 1 11:49:09 JST 2002 itojun@starfruit.itojun.org:/usr/home/itojun/NetBSD/src/sys/arch/i386/compile/STARFRUIT i386
Architecture: i386
Machine: i386
>Description:
with the current usr.bin/ftp, the behavior of "macdef" command is
rather non-intuitive.
- if you "macdef" the same macro name twice, they will be entered to
the macro database as a different macro. the first one defined is
actually invoked on $foo (2nd and other definitions are in memory,
but will not be used).
- if you define macro that expands to longer string, $n reference
will not work correctly.
>How-To-Repeat:
- repeat "macdef foo" for 16 times. see "Limit of 16 macros have
already been defined." error.
- do the following.
ftp> macdef hoge
Enter macro line by line, terminating it with a null line.
$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0
$1$1$1$1$1
$2$2$2$2$2
ftp> $hoge get
it will be expanded to the following three commands:
hogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehoge
ogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogeogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogeogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogeogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogeogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehogehoge
(empty string)
ftp> macdef hoge
Enter macro line by line, terminating it with a null line.
$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0
$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0
$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0$0
ftp> $hoge get
segmentation fault
>Fix:
revisit usr.bin/ftp/domacro.c
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: bin-bug-people->lukem
Responsible-Changed-By: fair
Responsible-Changed-When: Mon Feb 4 02:19:33 PST 2002
Responsible-Changed-Why:
Luke is our FTP client maintainer.
Responsible-Changed-From-To: lukem->bin-bug-people
Responsible-Changed-By: lukem@NetBSD.org
Responsible-Changed-When: Sat, 16 Jun 2012 07:22:55 +0000
Responsible-Changed-Why:
I'm not going to rewrite the ftp macro behaviour.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.