NetBSD Problem Report #47066
From kre@munnari.OZ.AU Sat Oct 13 11:20:35 2012
Received: from mail.netbsd.org (mail.netbsd.org [18.104.22.168])
by www.NetBSD.org (Postfix) with ESMTP id F30E763DD3F
for <gnats-bugs@gnats.NetBSD.org>; Sat, 13 Oct 2012 11:20:34 +0000 (UTC)
Date: Sat, 13 Oct 2012 18:20:27 +0700 (ICT)
Subject: net/libfetch ambiguity of 'a' flag for FTP
>Synopsis: net/libfetch ambiguity of 'a' flag for FTP
>Arrival-Date: Sat Oct 13 11:25:00 +0000 2012
>Last-Modified: Sat Oct 13 22:59:58 +0000 2012
>Originator: Robert Elz
>Release: NetBSD 5.1_STABLE (pkgsrc current 2012-10-12)
Prince of Songkla University
System: NetBSD jade.coe.psu.ac.th 5.1_STABLE NetBSD 5.1_STABLE (JADE-1.12-20120130) #27: Tue Jan 31 05:20:31 ICT 2012 firstname.lastname@example.org:/usr/obj/5/kernels/i386/JADE i386
ftp mode in libfetch uses the 'a' flag to mean both active mode
ftp, and append (when using ftp put)
One flag shouldn't mean two unrelated options (or not for the
same access method, as a minimum requirement).
By inspection of the source ...
grep "CHECK_FLAG('a')" *
ftp.c: pasv = !CHECK_FLAG('a');
ftp.c: return (ftp_request(url, CHECK_FLAG('a') ? "APPE" : "STOR", NULL, NULL,
This isn't all that serious (hence this non-critical/low PR) as none
of the clients of libfetch (that I could find anyway) seems to
have any mechanism for actually setting the 'a' flag (for either
of its potential uses).
It is unclear which of the two uses should get to retain ownership
of the 'a' flag, for file fetches 'a' means append, so that one
would be consistent (I know the flag meanings are defined to be
specific to an access method, so this consistency is not a requirement,
-- but I don't think much of that as a design choice), but 'a' for
active is kind of compelling. ('A' is also used, so that isn't
automatically a viable alternative).
'a' is in the fetch.3 FTP section as meaning active (not append)
(there's no way documented there to get the FTP APPE rather than STOR
command). Then again 'A' (noredirect) isn't documented either, so
as there's little intuitive rationale for that letter choice, or
not that I can fathom, perhaps 'A' could become append, in both
FTP and FILE access methods, 'a' could remain active, and no
redirect could become something else (N or R perhaps).
Or perhaps 'a' could remain append (for both file & ftp methods)
and 'A' could become active (with noredirect again being moved
to something else).
Pick some different option letter for (at least) one of the two uses,
and change the code. Update doc as appropriate, and clients of
libfetch if necessary.
Responsible-Changed-When: Sat, 13 Oct 2012 22:59:58 +0000
over to maintainer.
$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.