[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/47066: 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
>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
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.
Main Index |
Thread Index |