summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorlukem <lukem>2005-06-10 05:06:25 +0000
committerlukem <lukem>2005-06-10 05:06:25 +0000
commit362ee540695d973fda4b4401d39fec5aca494bfd (patch)
tree696ce1a24a0fad4694a3baa5d83bfc731dc80e09 /net
parent10e7c22a628711946c35fc963fcb2f4b7606c1e4 (diff)
downloadpkgsrc-362ee540695d973fda4b4401d39fec5aca494bfd.tar.gz
merge tnftp 20050610
Diffstat (limited to 'net')
-rw-r--r--net/tnftp/files/COPYING4
-rw-r--r--net/tnftp/files/ChangeLog142
-rw-r--r--net/tnftp/files/config.h.in5
-rwxr-xr-xnet/tnftp/files/configure441
-rw-r--r--net/tnftp/files/configure.in8
-rw-r--r--net/tnftp/files/libedit/Makefile.in10
-rw-r--r--net/tnftp/files/libedit/chared.c15
-rw-r--r--net/tnftp/files/libedit/common.c13
-rw-r--r--net/tnftp/files/libedit/editline.310
-rw-r--r--net/tnftp/files/libedit/el.c13
-rw-r--r--net/tnftp/files/libedit/emacs.c13
-rw-r--r--net/tnftp/files/libedit/hist.c13
-rw-r--r--net/tnftp/files/libedit/histedit.h5
-rw-r--r--net/tnftp/files/libedit/history.c13
-rw-r--r--net/tnftp/files/libedit/key.c13
-rw-r--r--net/tnftp/files/libedit/map.c13
-rw-r--r--net/tnftp/files/libedit/parse.c17
-rw-r--r--net/tnftp/files/libedit/parse.h6
-rw-r--r--net/tnftp/files/libedit/prompt.c13
-rw-r--r--net/tnftp/files/libedit/read.c20
-rw-r--r--net/tnftp/files/libedit/readline/readline.h9
-rw-r--r--net/tnftp/files/libedit/refresh.c13
-rw-r--r--net/tnftp/files/libedit/search.c13
-rw-r--r--net/tnftp/files/libedit/sig.c15
-rw-r--r--net/tnftp/files/libedit/sys.h8
-rw-r--r--net/tnftp/files/libedit/term.c13
-rw-r--r--net/tnftp/files/libedit/term.h5
-rw-r--r--net/tnftp/files/libedit/tokenizer.c13
-rw-r--r--net/tnftp/files/libedit/tty.c27
-rw-r--r--net/tnftp/files/libedit/tty.h6
-rw-r--r--net/tnftp/files/libedit/vi.c21
-rw-r--r--net/tnftp/files/libnetbsd/Makefile.in10
-rw-r--r--net/tnftp/files/libnetbsd/ftpglob.h10
-rw-r--r--net/tnftp/files/libnetbsd/ftpvis.h15
-rw-r--r--net/tnftp/files/libnetbsd/getnameinfo.c14
-rw-r--r--net/tnftp/files/libnetbsd/glob.c22
-rw-r--r--net/tnftp/files/libnetbsd/inet_ntop.c96
-rw-r--r--net/tnftp/files/libnetbsd/inet_pton.c79
-rw-r--r--net/tnftp/files/libnetbsd/mkstemp.c18
-rw-r--r--net/tnftp/files/libnetbsd/sl_init.c11
-rw-r--r--net/tnftp/files/libnetbsd/strdup.c10
-rw-r--r--net/tnftp/files/libnetbsd/strlcat.c44
-rw-r--r--net/tnftp/files/libnetbsd/strlcpy.c37
-rw-r--r--net/tnftp/files/libnetbsd/strsep.c10
-rw-r--r--net/tnftp/files/libnetbsd/strtoll.c25
-rw-r--r--net/tnftp/files/libnetbsd/strunvis.c91
-rw-r--r--net/tnftp/files/libnetbsd/strvis.c388
-rw-r--r--net/tnftp/files/libnetbsd/usleep.c10
-rw-r--r--net/tnftp/files/src/Makefile.in22
-rw-r--r--net/tnftp/files/src/cmds.c63
-rw-r--r--net/tnftp/files/src/cmdtab.c17
-rw-r--r--net/tnftp/files/src/complete.c17
-rw-r--r--net/tnftp/files/src/domacro.c13
-rw-r--r--net/tnftp/files/src/extern.h14
-rw-r--r--net/tnftp/files/src/fetch.c59
-rw-r--r--net/tnftp/files/src/ftp.c48
-rw-r--r--net/tnftp/files/src/main.c55
-rw-r--r--net/tnftp/files/src/progressbar.c25
-rw-r--r--net/tnftp/files/src/ruserpass.c23
-rw-r--r--net/tnftp/files/src/util.c318
-rw-r--r--net/tnftp/files/src/version.h5
-rw-r--r--net/tnftp/files/tnftp.h48
62 files changed, 1420 insertions, 1127 deletions
diff --git a/net/tnftp/files/COPYING b/net/tnftp/files/COPYING
index 3019e95559c..5f20d102895 100644
--- a/net/tnftp/files/COPYING
+++ b/net/tnftp/files/COPYING
@@ -1,4 +1,4 @@
-NetBSD: COPYING,v 1.4 2005/05/11 03:03:42 lukem Exp
+NetBSD: COPYING,v 1.5 2005/05/28 13:15:14 lukem Exp
Copyright (c) 2001-2005 The NetBSD Foundation, Inc.
All rights reserved.
@@ -42,11 +42,13 @@ acknowledgements:
This product includes software developed by the NetBSD Foundation,
Inc. and its contributors. Those contributors include:
+ - Simon Burge
- Jaromir Dolecek
- Klaus Klein
- Luke Mewburn
- Jason R. Thorpe of the Numerical Aerospace Simulation
Facility, NASA Ames Research Center.
+ - Christos Zoulas
This product includes software developed by the University of
California, Berkeley and its contributors. Those contributors include:
diff --git a/net/tnftp/files/ChangeLog b/net/tnftp/files/ChangeLog
index 7f552b8faca..576b5e6e202 100644
--- a/net/tnftp/files/ChangeLog
+++ b/net/tnftp/files/ChangeLog
@@ -1,4 +1,144 @@
-NetBSD: ChangeLog,v 1.17 2005/05/14 04:46:26 lukem Exp
+NetBSD: ChangeLog,v 1.27 2005/06/10 04:40:13 lukem Exp
+
+Fri Jun 10 04:39:33 UTC 2005 lukem
+
+ * Release as "tnftp 20050610"
+
+ * Add dependencies on ${srcdir}/../tnftp.h and ../config.h
+
+ * Merge NetBSD ftp from 20050609 to 20050610. Changes:
+ - Implement getline() to read a line into a buffer.
+ - Convert to use getline() instead of fgets() whenever reading
+ user input to ensure that an overly long input line doesn't
+ leave excess characters for the next input operation to
+ accidentally use as input.
+ - Zero out the password & account after we've finished with it.
+ - Consistently use getpass(3) (i.e, character echo suppressed)
+ when reading the account data. For some reason, historically
+ the "login" code suppressed echo for Account: yet the "user"
+ command did not!
+ - Display the hostname in the "getaddrinfo failed" warning.
+ - Appease some -Wcast-qual warnings. Fixing all of these
+ requires significant code refactoring. (mmm, legacy code).
+
+Thu Jun 9 16:49:05 UTC 2005 lukem
+
+ * src, libnetbsd: Excise RCSID block, rather than using
+ #if 0 ... #endif. The point was to minimise RCSID
+ conflicts, and the latter isn't helping there.
+
+ * Merge NetBSD ftp from 20050531 to 20050609. Changes:
+ - Only print the "Trying <address>..." message if verbose
+ and there's more than one struct addrinfo in the
+ getaddrinfo() result.
+ - Don't use non-standard "u_int".
+
+Wed Jun 1 15:08:01 UTC 2005 lukem
+
+ * Look for dirname(3), which may be in -lgen on IRIX, and
+ replace it if not found..
+
+Wed Jun 1 11:48:58 UTC 2005 lukem
+
+ * libnetbsd:
+ - Don't use non-standard: u_char u_short u_int.
+ - Use uint32_t instead of u_int32_t.
+ - Don't use register.
+
+ * libedit: Don't use non-standard uint or u_int.
+
+Tue May 31 02:23:08 UTC 2005 lukem
+
+ * tnftp.h: need <libgen.h> for dirname(3)
+
+ * Merge ftp from 20050513 to 20050531. Changes:
+ - Helps if the definition of xconnect() matches its
+ declaration....
+ - Fix some cast issues highlighted by Scott Reynolds using
+ gcc 4 on OSX.4
+ - Use size_t instead of int where appropriate.
+ - Make this compile on sparc64 (size_t != int).
+ - Printf field widths and size_t don't always mix well, so
+ cast to int. Fixes build problem for alpha.
+ - Some const cleanups.
+ - tab cleanup
+ - Improve method used in fileindir() to determine if `file'
+ is in or under `dir': realpath(3) on non-NetBSD systems may
+ fail if the target filename doesn't exist, so instead use
+ realpath(3) on the parent directory of `file'.
+ Per discussion with Todd Eigenschink.
+ - formatbuf(): fix %m and %M to use the hostname, not the
+ username.
+ - fetch_ftp(): preserve 'anonftp' across a disconnect() so
+ that multiple ftp auto-fetches on the same command line
+ login automatically.
+ - auto_fetch(): use an initialized volatile int to appease
+ IRIX cc.
+
+ * Merge libedit from NetBSD 20050105 to 20050531. Changes include:
+ - Rui Paulo: Incorrect tok_line and tok_str declarations.
+ - Remove clause 3 from the UCB license.
+ - Luke Mewburn: Don't abuse unconstify'ing a string
+ and writing to it, because you'll core dump. Also remove
+ extra const that gives pain to the irix compiler.
+ - Make sure we flush after we prepare when we are unbuffered
+ otherwise the prompt will not appear immediately.
+ - Terminate the arglist with a NULL instead of 0.
+ (Shuts up gcc4.x)
+
+Sat May 28 13:19:38 UTC 2005 lukem
+
+ * libnetbsd/strvis.c:
+ - Sync to NetBSD's vis.c 1.33:
+ Use malloc(3) instead of alloca(3).
+ - Remove extraenous #endif
+
+Fri May 27 05:46:58 UTC 2005 lukem
+
+ * libnetbsd/strvis.c: Sync to NetBSD's vis.c 1.30:
+ Use a more standard TNF license.
+
+ * libedit/sig.c: Include "src/progressbar.h" for xsignal_restart()
+ prototype.
+
+ * Ensure that fallback #define of __attribute__ is available.
+ Fixes build problem on HP-UX with cc.
+
+Thu May 26 14:21:08 UTC 2005 lukem
+
+ * Extend xpoll()'s HAVE_SELECT implementation to support POLLRDNORM,
+ POLLWRNORM, and POLLRDBAND - the latter using exceptfds.
+ Per discussion with Christos Zoulas.
+
+Mon May 16 13:33:27 UTC 2005 lukem
+
+ * Pull in <poll.h> or <sys/poll.h> if they exist even if we're
+ not using poll, as struct pollfd might exist in those.
+ Fixes build problem on OSX.3.
+
+ * Separate CPPFLAGS from CFLAGS.
+
+ * Sync various files in libnetbsd with the original versions
+ in NetBSD. Notable changes
+ - Convert 4 clause UCB license to 3 clause.
+ - Use strlcpy instead of strcpy.
+ - Update ISC copyright.
+ - Use NS_INADDRSZ, NS_IN6ADDRSZ and NS_INT16SZ instead of
+ equivalents without NS_ prefix.
+ - Use socklen_t instead of size_t where appropriate.
+ - Improve bounds checking.
+ - Don't update the size of allocated storage until
+ realloc succeeds.
+ - Fix comment about return value.
+ - Reverse the order of two loop invariant to make
+ 'strlcat(0, "foo", 0)' not get a SEGV.
+ - Use Todd C. Miller's latest copyright notice (more loose).
+ - Use "long long" instead of "quad" in various
+ comments & constants.
+ - Support VIS_HTTPSTYLE.
+ - Implement svis(), strsvis(), strsvisx(), strunvisx().
+
+ * Prefer poll over select when implementing replacement usleep().
Sat May 14 04:44:35 UTC 2005 lukem
diff --git a/net/tnftp/files/config.h.in b/net/tnftp/files/config.h.in
index f4d3383d038..ca8f9600d90 100644
--- a/net/tnftp/files/config.h.in
+++ b/net/tnftp/files/config.h.in
@@ -1,5 +1,5 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
-/* NetBSD: config.h.in,v 1.9 2005/05/14 04:41:27 lukem Exp */
+/* NetBSD: config.h.in,v 1.10 2005/06/01 15:10:21 lukem Exp */
/* Define if on AIX 3.
@@ -45,6 +45,9 @@
/* The number of bytes in a off_t. */
#undef SIZEOF_OFF_T
+/* Define if you have the dirname function. */
+#undef HAVE_DIRNAME
+
/* Define if you have the err function. */
#undef HAVE_ERR
diff --git a/net/tnftp/files/configure b/net/tnftp/files/configure
index 86c6aaecb05..e4d4c7492b4 100755
--- a/net/tnftp/files/configure
+++ b/net/tnftp/files/configure
@@ -1,6 +1,6 @@
#! /bin/sh
-# From configure.in Revision: 1.13
+# From configure.in Revision: 1.16
@@ -1310,15 +1310,77 @@ else :
fi
fi
+echo $ac_n "checking for library containing dirname""... $ac_c" 1>&6
+echo "configure:1315: checking for library containing dirname" >&5
+if eval "test \"`echo '$''{'ac_cv_search_dirname'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_func_search_save_LIBS="$LIBS"
+ac_cv_search_dirname="no"
+cat > conftest.$ac_ext <<EOF
+#line 1322 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dirname();
+
+int main() {
+dirname()
+; return 0; }
+EOF
+if { (eval echo configure:1333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_dirname="none required"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+test "$ac_cv_search_dirname" = "no" && for i in gen; do
+LIBS="-l$i $ac_func_search_save_LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1344 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dirname();
+
+int main() {
+dirname()
+; return 0; }
+EOF
+if { (eval echo configure:1355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ ac_cv_search_dirname="-l$i"
+break
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+done
+LIBS="$ac_func_search_save_LIBS"
+fi
+
+echo "$ac_t""$ac_cv_search_dirname" 1>&6
+if test "$ac_cv_search_dirname" != "no"; then
+ test "$ac_cv_search_dirname" = "none required" || LIBS="$ac_cv_search_dirname $LIBS"
+ have_dirname=yes
+else :
+ have_dirname=no
+fi
+
# Most operating systems have gethostbyname() in the default searched
# libraries (i.e. libc):
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:1317: checking for gethostbyname" >&5
+echo "configure:1379: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1322 "configure"
+#line 1384 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -1341,7 +1403,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:1345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@@ -1360,7 +1422,7 @@ else
echo "$ac_t""no" 1>&6
# Some OSes (eg. Solaris) place it in libnsl:
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:1364: checking for gethostbyname in -lnsl" >&5
+echo "configure:1426: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1368,7 +1430,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1372 "configure"
+#line 1434 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1379,7 +1441,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1406,7 +1468,7 @@ else
echo "$ac_t""no" 1>&6
# Some strange OSes (SINIX) have it in libsocket:
echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6
-echo "configure:1410: checking for gethostbyname in -lsocket" >&5
+echo "configure:1472: checking for gethostbyname in -lsocket" >&5
ac_lib_var=`echo socket'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1414,7 +1476,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1418 "configure"
+#line 1480 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1425,7 +1487,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1454,7 +1516,7 @@ else
# AC_CHECK_LIB's API is essentially broken so the following
# ugliness is necessary:
echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6
-echo "configure:1458: checking for gethostbyname in -lsocket" >&5
+echo "configure:1520: checking for gethostbyname in -lsocket" >&5
ac_lib_var=`echo socket'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1462,7 +1524,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket -lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1466 "configure"
+#line 1528 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1473,7 +1535,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1477: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1492,7 +1554,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6
-echo "configure:1496: checking for gethostbyname in -lresolv" >&5
+echo "configure:1558: checking for gethostbyname in -lresolv" >&5
ac_lib_var=`echo resolv'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1500,7 +1562,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lresolv $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1504 "configure"
+#line 1566 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1511,7 +1573,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:1515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1550,12 +1612,12 @@ fi
fi
echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:1554: checking for socket" >&5
+echo "configure:1616: checking for socket" >&5
if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1559 "configure"
+#line 1621 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char socket(); below. */
@@ -1578,7 +1640,7 @@ socket();
; return 0; }
EOF
-if { (eval echo configure:1582: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_socket=yes"
else
@@ -1596,7 +1658,7 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1600: checking for socket in -lsocket" >&5
+echo "configure:1662: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1604,7 +1666,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1608 "configure"
+#line 1670 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1615,7 +1677,7 @@ int main() {
socket()
; return 0; }
EOF
-if { (eval echo configure:1619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1641,7 +1703,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:1645: checking for socket in -lsocket" >&5
+echo "configure:1707: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1649,7 +1711,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket -lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1653 "configure"
+#line 1715 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1660,7 +1722,7 @@ int main() {
socket()
; return 0; }
EOF
-if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1687,7 +1749,7 @@ fi
echo $ac_n "checking whether to support SOCKS""... $ac_c" 1>&6
-echo "configure:1691: checking whether to support SOCKS" >&5
+echo "configure:1753: checking whether to support SOCKS" >&5
# Check whether --with-socks or --without-socks was given.
if test "${with_socks+set}" = set; then
withval="$with_socks"
@@ -1699,7 +1761,7 @@ if test "${with_socks+set}" = set; then
yes)
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for SOCKSconnect in -lsocks5""... $ac_c" 1>&6
-echo "configure:1703: checking for SOCKSconnect in -lsocks5" >&5
+echo "configure:1765: checking for SOCKSconnect in -lsocks5" >&5
ac_lib_var=`echo socks5'_'SOCKSconnect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1707,7 +1769,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocks5 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1711 "configure"
+#line 1773 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1718,7 +1780,7 @@ int main() {
SOCKSconnect()
; return 0; }
EOF
-if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1740,7 +1802,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for Rconnect in -lsocks""... $ac_c" 1>&6
-echo "configure:1744: checking for Rconnect in -lsocks" >&5
+echo "configure:1806: checking for Rconnect in -lsocks" >&5
ac_lib_var=`echo socks'_'Rconnect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1748,7 +1810,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocks $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1752 "configure"
+#line 1814 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1759,7 +1821,7 @@ int main() {
Rconnect()
; return 0; }
EOF
-if { (eval echo configure:1763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1796,7 +1858,7 @@ fi
if test "x$socks" = "x"; then
echo $ac_n "checking whether to support SOCKS5""... $ac_c" 1>&6
-echo "configure:1800: checking whether to support SOCKS5" >&5
+echo "configure:1862: checking whether to support SOCKS5" >&5
# Check whether --with-socks5 or --without-socks5 was given.
if test "${with_socks5+set}" = set; then
withval="$with_socks5"
@@ -1831,14 +1893,14 @@ if test "${with_socks5+set}" = set; then
TMPLIBS="$LIBS"
LIBS="$LIBS $KERBEROS_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1835 "configure"
+#line 1897 "configure"
#include "confdefs.h"
int main() {
SOCKSconnect();
; return 0; }
EOF
-if { (eval echo configure:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -1860,7 +1922,7 @@ fi
if test "x$socks" = "x"; then
echo $ac_n "checking whether to support SOCKS4""... $ac_c" 1>&6
-echo "configure:1864: checking whether to support SOCKS4" >&5
+echo "configure:1926: checking whether to support SOCKS4" >&5
# Check whether --with-socks4 or --without-socks4 was given.
if test "${with_socks4+set}" = set; then
withval="$with_socks4"
@@ -1881,14 +1943,14 @@ if test "${with_socks4+set}" = set; then
fi
LIBS="$withval $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1885 "configure"
+#line 1947 "configure"
#include "confdefs.h"
int main() {
Rconnect();
; return 0; }
EOF
-if { (eval echo configure:1892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
:
else
echo "configure: failed program was:" >&5
@@ -2051,12 +2113,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:2055: checking for $ac_hdr that defines DIR" >&5
+echo "configure:2117: checking for $ac_hdr that defines DIR" >&5
if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2060 "configure"
+#line 2122 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_hdr>
@@ -2064,7 +2126,7 @@ int main() {
DIR *dirp = 0;
; return 0; }
EOF
-if { (eval echo configure:2068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "ac_cv_header_dirent_$ac_safe=yes"
else
@@ -2089,7 +2151,7 @@ done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:2093: checking for opendir in -ldir" >&5
+echo "configure:2155: checking for opendir in -ldir" >&5
ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2097,7 +2159,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldir $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2101 "configure"
+#line 2163 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2108,7 +2170,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:2112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2130,7 +2192,7 @@ fi
else
echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:2134: checking for opendir in -lx" >&5
+echo "configure:2196: checking for opendir in -lx" >&5
ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2138,7 +2200,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lx $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2142 "configure"
+#line 2204 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2149,7 +2211,7 @@ int main() {
opendir()
; return 0; }
EOF
-if { (eval echo configure:2153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2172,12 +2234,12 @@ fi
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2176: checking for ANSI C header files" >&5
+echo "configure:2238: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2181 "configure"
+#line 2243 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2185,7 +2247,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2189: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2202,7 +2264,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2206 "configure"
+#line 2268 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2220,7 +2282,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 2224 "configure"
+#line 2286 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2241,7 +2303,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2245 "configure"
+#line 2307 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2252,7 +2314,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2280,17 +2342,17 @@ for ac_hdr in arpa/nameser.h err.h regex.h paths.h poll.h sys/poll.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2284: checking for $ac_hdr" >&5
+echo "configure:2346: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2289 "configure"
+#line 2351 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2356: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2319,12 +2381,12 @@ done
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2323: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2385: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2328 "configure"
+#line 2390 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2333,7 +2395,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2337: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2399: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2354,12 +2416,12 @@ EOF
fi
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:2358: checking for off_t" >&5
+echo "configure:2420: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2363 "configure"
+#line 2425 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2387,7 +2449,7 @@ EOF
fi
echo $ac_n "checking size of off_t""... $ac_c" 1>&6
-echo "configure:2391: checking size of off_t" >&5
+echo "configure:2453: checking size of off_t" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2395,7 +2457,7 @@ else
ac_cv_sizeof_off_t=0
else
cat > conftest.$ac_ext <<EOF
-#line 2399 "configure"
+#line 2461 "configure"
#include "confdefs.h"
#include <stdio.h>
main()
@@ -2406,7 +2468,7 @@ main()
exit(0);
}
EOF
-if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_sizeof_off_t=`cat conftestval`
else
@@ -2427,13 +2489,13 @@ EOF
echo $ac_n "checking for long long""... $ac_c" 1>&6
-echo "configure:2431: checking for long long" >&5
+echo "configure:2493: checking for long long" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_LONG_LONG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2437 "configure"
+#line 2499 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2445,7 +2507,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ftp_cv_HAVE_LONG_LONG=yes
else
@@ -2475,13 +2537,13 @@ EOF
echo $ac_n "checking for in_port_t""... $ac_c" 1>&6
-echo "configure:2479: checking for in_port_t" >&5
+echo "configure:2541: checking for in_port_t" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_IN_PORT_T'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2485 "configure"
+#line 2547 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2491,7 +2553,7 @@ int main() {
in_port_t X ;
; return 0; }
EOF
-if { (eval echo configure:2495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_IN_PORT_T=yes
else
@@ -2518,13 +2580,13 @@ EOF
echo $ac_n "checking for sa_family_t""... $ac_c" 1>&6
-echo "configure:2522: checking for sa_family_t" >&5
+echo "configure:2584: checking for sa_family_t" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_SA_FAMILY_T'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2528 "configure"
+#line 2590 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2534,7 +2596,7 @@ int main() {
sa_family_t X ;
; return 0; }
EOF
-if { (eval echo configure:2538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2600: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_SA_FAMILY_T=yes
else
@@ -2561,13 +2623,13 @@ EOF
echo $ac_n "checking for sockaddr_in.sin_len""... $ac_c" 1>&6
-echo "configure:2565: checking for sockaddr_in.sin_len" >&5
+echo "configure:2627: checking for sockaddr_in.sin_len" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKADDR_SA_LEN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2571 "configure"
+#line 2633 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2581,7 +2643,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:2585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_SOCKADDR_SA_LEN=yes
else
@@ -2608,13 +2670,13 @@ EOF
echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:2612: checking for socklen_t" >&5
+echo "configure:2674: checking for socklen_t" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKLEN_T'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2618 "configure"
+#line 2680 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2624,7 +2686,7 @@ int main() {
socklen_t X ;
; return 0; }
EOF
-if { (eval echo configure:2628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_SOCKLEN_T=yes
else
@@ -2653,13 +2715,13 @@ if test $opt_ipv6 = yes; then
echo $ac_n "checking for AF_INET6""... $ac_c" 1>&6
-echo "configure:2657: checking for AF_INET6" >&5
+echo "configure:2719: checking for AF_INET6" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_AF_INET6'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2663 "configure"
+#line 2725 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2669,7 +2731,7 @@ int main() {
int X = AF_INET6 ;
; return 0; }
EOF
-if { (eval echo configure:2673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_AF_INET6=yes
else
@@ -2696,13 +2758,13 @@ EOF
echo $ac_n "checking for struct sockaddr_in6""... $ac_c" 1>&6
-echo "configure:2700: checking for struct sockaddr_in6" >&5
+echo "configure:2762: checking for struct sockaddr_in6" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKADDR_IN6'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2706 "configure"
+#line 2768 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2715,7 +2777,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:2719: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_SOCKADDR_IN6=yes
else
@@ -2743,13 +2805,13 @@ EOF
if test $ac_cv_header_arpa_nameser_h = yes; then
echo $ac_n "checking for IN6ADDRSZ in arpa/nameser.h""... $ac_c" 1>&6
-echo "configure:2747: checking for IN6ADDRSZ in arpa/nameser.h" >&5
+echo "configure:2809: checking for IN6ADDRSZ in arpa/nameser.h" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_IN6ADDRSZ'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2753 "configure"
+#line 2815 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2759,7 +2821,7 @@ int main() {
int X = IN6ADDRSZ ;
; return 0; }
EOF
-if { (eval echo configure:2763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2825: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_IN6ADDRSZ=yes
else
@@ -2789,13 +2851,13 @@ fi
echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6
-echo "configure:2793: checking for struct addrinfo" >&5
+echo "configure:2855: checking for struct addrinfo" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_ADDRINFO'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2799 "configure"
+#line 2861 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -2806,7 +2868,7 @@ int main() {
struct addrinfo X ;
; return 0; }
EOF
-if { (eval echo configure:2810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_ADDRINFO=yes
else
@@ -2833,13 +2895,13 @@ EOF
echo $ac_n "checking for d_namlen in struct dirent""... $ac_c" 1>&6
-echo "configure:2837: checking for d_namlen in struct dirent" >&5
+echo "configure:2899: checking for d_namlen in struct dirent" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_D_NAMLEN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2843 "configure"
+#line 2905 "configure"
#include "confdefs.h"
#if HAVE_DIRENT_H
@@ -2864,7 +2926,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:2868: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2930: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_D_NAMLEN=yes
else
@@ -2891,13 +2953,13 @@ EOF
echo $ac_n "checking for h_errno declaration""... $ac_c" 1>&6
-echo "configure:2895: checking for h_errno declaration" >&5
+echo "configure:2957: checking for h_errno declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_H_ERRNO_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2901 "configure"
+#line 2963 "configure"
#include "confdefs.h"
#include <netdb.h>
@@ -2906,7 +2968,7 @@ int main() {
int X = h_errno ;
; return 0; }
EOF
-if { (eval echo configure:2910: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_H_ERRNO_D=yes
else
@@ -2933,13 +2995,13 @@ EOF
echo $ac_n "checking for fclose() declaration""... $ac_c" 1>&6
-echo "configure:2937: checking for fclose() declaration" >&5
+echo "configure:2999: checking for fclose() declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_FCLOSE_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2943 "configure"
+#line 3005 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -2948,7 +3010,7 @@ int main() {
int (*X)() = fclose ;
; return 0; }
EOF
-if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_FCLOSE_D=yes
else
@@ -2975,13 +3037,13 @@ EOF
echo $ac_n "checking for getpass() declaration""... $ac_c" 1>&6
-echo "configure:2979: checking for getpass() declaration" >&5
+echo "configure:3041: checking for getpass() declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_GETPASS_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2985 "configure"
+#line 3047 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -2991,7 +3053,7 @@ int main() {
char *(*X)() = getpass ;
; return 0; }
EOF
-if { (eval echo configure:2995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_GETPASS_D=yes
else
@@ -3018,13 +3080,13 @@ EOF
echo $ac_n "checking for optarg declaration""... $ac_c" 1>&6
-echo "configure:3022: checking for optarg declaration" >&5
+echo "configure:3084: checking for optarg declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_OPTARG_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3028 "configure"
+#line 3090 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3034,7 +3096,7 @@ int main() {
char *X = optarg ;
; return 0; }
EOF
-if { (eval echo configure:3038: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_OPTARG_D=yes
else
@@ -3061,13 +3123,13 @@ EOF
echo $ac_n "checking for optind declaration""... $ac_c" 1>&6
-echo "configure:3065: checking for optind declaration" >&5
+echo "configure:3127: checking for optind declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_OPTIND_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3071 "configure"
+#line 3133 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -3077,7 +3139,7 @@ int main() {
int X = optind ;
; return 0; }
EOF
-if { (eval echo configure:3081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_OPTIND_D=yes
else
@@ -3104,13 +3166,13 @@ EOF
echo $ac_n "checking for pclose() declaration""... $ac_c" 1>&6
-echo "configure:3108: checking for pclose() declaration" >&5
+echo "configure:3170: checking for pclose() declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_PCLOSE_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3114 "configure"
+#line 3176 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3119,7 +3181,7 @@ int main() {
int (*X)() = pclose ;
; return 0; }
EOF
-if { (eval echo configure:3123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3185: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_PCLOSE_D=yes
else
@@ -3151,12 +3213,12 @@ for ac_func in err fgetln fseeko getaddrinfo getnameinfo inet_ntop \
strvis timegm usleep utimes
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3155: checking for $ac_func" >&5
+echo "configure:3217: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3160 "configure"
+#line 3222 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3179,7 +3241,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3208,12 +3270,12 @@ done
for ac_func in gethostbyname2 getpassphrase getpgrp memmove select
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3212: checking for $ac_func" >&5
+echo "configure:3274: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3217 "configure"
+#line 3279 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3236,7 +3298,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3264,12 +3326,71 @@ if test $have_fparseln != yes; then
for ac_func in fparseln
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3268: checking for $ac_func" >&5
+echo "configure:3330: checking for $ac_func" >&5
+if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 3335 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
+fi
+done
+
+
+fi
+if test $have_dirname != yes; then
+ for ac_func in dirname
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:3389: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3273 "configure"
+#line 3394 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3292,7 +3413,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3321,7 +3442,7 @@ done
fi
if test $ac_cv_func_getpgrp = yes; then
echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:3325: checking whether getpgrp takes no argument" >&5
+echo "configure:3446: checking whether getpgrp takes no argument" >&5
if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3329,7 +3450,7 @@ else
{ echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 3333 "configure"
+#line 3454 "configure"
#include "confdefs.h"
/*
@@ -3384,7 +3505,7 @@ main()
}
EOF
-if { (eval echo configure:3388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
ac_cv_func_getpgrp_void=yes
else
@@ -3414,13 +3535,13 @@ LIBOBJS="$LIBOBJS glob.o"
if test $ac_cv_func_strptime = yes; then
echo $ac_n "checking for strptime() declaration""... $ac_c" 1>&6
-echo "configure:3418: checking for strptime() declaration" >&5
+echo "configure:3539: checking for strptime() declaration" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_STRPTIME_D'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3424 "configure"
+#line 3545 "configure"
#include "confdefs.h"
#include <time.h>
@@ -3431,7 +3552,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:3435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_STRPTIME_D=yes
else
@@ -3461,13 +3582,13 @@ if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
echo $ac_n "checking *printf() support for %lld""... $ac_c" 1>&6
-echo "configure:3465: checking *printf() support for %lld" >&5
+echo "configure:3586: checking *printf() support for %lld" >&5
can_printf_longlong=no
if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3471 "configure"
+#line 3592 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3478,7 +3599,7 @@ int main() {
}
EOF
-if { (eval echo configure:3482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
@@ -3498,12 +3619,12 @@ fi
if test $can_printf_longlong != yes; then
echo $ac_n "checking *printf() support for %qd""... $ac_c" 1>&6
-echo "configure:3502: checking *printf() support for %qd" >&5
+echo "configure:3623: checking *printf() support for %qd" >&5
if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 3507 "configure"
+#line 3628 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3514,7 +3635,7 @@ int main() {
}
EOF
-if { (eval echo configure:3518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo "$ac_t""yes" 1>&6
@@ -3545,12 +3666,12 @@ EOF
for ac_func in strtoll
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3549: checking for $ac_func" >&5
+echo "configure:3670: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3554 "configure"
+#line 3675 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3573,7 +3694,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -3605,12 +3726,12 @@ fi
if test $ac_cv_header_poll_h = yes || test $ac_cv_header_sys_poll_h = yes; then
echo $ac_n "checking for poll""... $ac_c" 1>&6
-echo "configure:3609: checking for poll" >&5
+echo "configure:3730: checking for poll" >&5
if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3614 "configure"
+#line 3735 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char poll(); below. */
@@ -3633,7 +3754,7 @@ poll();
; return 0; }
EOF
-if { (eval echo configure:3637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_poll=yes"
else
@@ -3650,13 +3771,13 @@ if eval "test \"`echo '$ac_cv_func_'poll`\" = yes"; then
echo $ac_n "checking if poll() is implemented natively""... $ac_c" 1>&6
-echo "configure:3654: checking if poll() is implemented natively" >&5
+echo "configure:3775: checking if poll() is implemented natively" >&5
if eval "test \"`echo '$''{'ftp_cv_POLL_NATIVE'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3660 "configure"
+#line 3781 "configure"
#include "confdefs.h"
#if HAVE_POLL_H
@@ -3674,7 +3795,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:3678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3799: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_POLL_NATIVE=yes
else
@@ -3706,13 +3827,13 @@ fi
echo $ac_n "checking for struct pollfd""... $ac_c" 1>&6
-echo "configure:3710: checking for struct pollfd" >&5
+echo "configure:3831: checking for struct pollfd" >&5
if eval "test \"`echo '$''{'ftp_cv_HAVE_STRUCT_POLLFD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3716 "configure"
+#line 3837 "configure"
#include "confdefs.h"
#if HAVE_POLL_H
@@ -3726,7 +3847,7 @@ int main() {
struct pollfd X ;
; return 0; }
EOF
-if { (eval echo configure:3730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_HAVE_STRUCT_POLLFD=yes
else
@@ -3757,13 +3878,13 @@ if test $opt_editcomplete = yes; then
if test $have_libedit = yes; then
echo $ac_n "checking for EL_RPROMPT in libedit""... $ac_c" 1>&6
-echo "configure:3761: checking for EL_RPROMPT in libedit" >&5
+echo "configure:3882: checking for EL_RPROMPT in libedit" >&5
if eval "test \"`echo '$''{'ftp_cv_have_libedit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3767 "configure"
+#line 3888 "configure"
#include "confdefs.h"
#include <histedit.h>
@@ -3772,7 +3893,7 @@ int main() {
int X = EL_RPROMPT ;
; return 0; }
EOF
-if { (eval echo configure:3776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3897: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_have_libedit=yes
else
@@ -3798,7 +3919,7 @@ echo "$ac_t""$ftp_cv_have_libedit" 1>&6
have_libedit=no
echo $ac_n "checking for up-to-date libedit""... $ac_c" 1>&6
-echo "configure:3802: checking for up-to-date libedit" >&5
+echo "configure:3923: checking for up-to-date libedit" >&5
if test $have_libedit = no; then
echo "$ac_t""no - using my own" 1>&6
INCLUDES="-I\${srcdir}/../libedit $INCLUDES"
@@ -3816,13 +3937,13 @@ fi
if test $ac_cv_func_sl_init = yes; then
echo $ac_n "checking if sl_add() returns int""... $ac_c" 1>&6
-echo "configure:3820: checking if sl_add() returns int" >&5
+echo "configure:3941: checking if sl_add() returns int" >&5
if eval "test \"`echo '$''{'ftp_cv_INT_SL_ADD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3826 "configure"
+#line 3947 "configure"
#include "confdefs.h"
#include <stringlist.h>
@@ -3833,7 +3954,7 @@ int main() {
;
; return 0; }
EOF
-if { (eval echo configure:3837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_INT_SL_ADD=yes
else
@@ -3861,13 +3982,13 @@ have_rfc2553_netdb=no
if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then
echo $ac_n "checking for AI_NUMERICHOST""... $ac_c" 1>&6
-echo "configure:3865: checking for AI_NUMERICHOST" >&5
+echo "configure:3986: checking for AI_NUMERICHOST" >&5
if eval "test \"`echo '$''{'ftp_cv_have_ai_numerichost'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3871 "configure"
+#line 3992 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -3878,7 +3999,7 @@ int main() {
int X = AI_NUMERICHOST ;
; return 0; }
EOF
-if { (eval echo configure:3882: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4003: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_have_ai_numerichost=yes
else
@@ -3901,7 +4022,7 @@ echo "$ac_t""$ftp_cv_have_ai_numerichost" 1>&6
fi
echo $ac_n "checking for working getaddrinfo()""... $ac_c" 1>&6
-echo "configure:3905: checking for working getaddrinfo()" >&5
+echo "configure:4026: checking for working getaddrinfo()" >&5
if test $have_rfc2553_netdb = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_RFC2553_NETDB 1
@@ -3921,13 +4042,13 @@ fi
if test $ac_cv_header_vis_h = yes; then
echo $ac_n "checking for VIS_WHITE in vis.h""... $ac_c" 1>&6
-echo "configure:3925: checking for VIS_WHITE in vis.h" >&5
+echo "configure:4046: checking for VIS_WHITE in vis.h" >&5
if eval "test \"`echo '$''{'ftp_cv_have_vis_white'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3931 "configure"
+#line 4052 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -3937,7 +4058,7 @@ int main() {
int X = VIS_WHITE ;
; return 0; }
EOF
-if { (eval echo configure:3941: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ftp_cv_have_vis_white=yes
else
diff --git a/net/tnftp/files/configure.in b/net/tnftp/files/configure.in
index 4b1aa419d5f..8d979674d2c 100644
--- a/net/tnftp/files/configure.in
+++ b/net/tnftp/files/configure.in
@@ -1,10 +1,10 @@
-dnl NetBSD: configure.in,v 1.13 2005/05/14 04:34:50 lukem Exp
+dnl NetBSD: configure.in,v 1.16 2005/06/02 00:20:32 lukem Exp
dnl
dnl configure.in --
dnl process this file with autoconf to produce a configure script.
dnl
-AC_REVISION([Revision: 1.13])dnl
+AC_REVISION([Revision: 1.16])dnl
AC_INIT(tnftp.h)
@@ -43,6 +43,7 @@ if test $opt_editcomplete = yes; then
AC_MSG_ERROR([no relevant library found containing tgetent]))
AC_SEARCH_LIBS(el_init, [edit], [have_libedit=yes], [have_libedit=no])
fi
+AC_SEARCH_LIBS(dirname, [gen], [have_dirname=yes], [have_dirname=no])
AC_LIBRARY_NET
AC_LIBRARY_SOCKS
if test -n "$socks"; then
@@ -191,6 +192,9 @@ AC_CHECK_FUNCS([gethostbyname2 getpassphrase getpgrp memmove select])
if test $have_fparseln != yes; then
AC_REPLACE_FUNCS(fparseln)
fi
+if test $have_dirname != yes; then
+ AC_REPLACE_FUNCS(dirname)
+fi
if test $ac_cv_func_getpgrp = yes; then
AC_FUNC_GETPGRP
fi
diff --git a/net/tnftp/files/libedit/Makefile.in b/net/tnftp/files/libedit/Makefile.in
index 85daedde427..8ed603d3d54 100644
--- a/net/tnftp/files/libedit/Makefile.in
+++ b/net/tnftp/files/libedit/Makefile.in
@@ -1,4 +1,4 @@
-# NetBSD: Makefile.in,v 1.2 2005/05/11 01:17:39 lukem Exp
+# NetBSD: Makefile.in,v 1.4 2005/06/10 04:36:12 lukem Exp
#
srcdir = @srcdir@
@@ -6,7 +6,8 @@ VPATH = @srcdir@
SHELL = /bin/sh
CC = @CC@
-CFLAGS = -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CFLAGS@
+CFLAGS = @CFLAGS@
+CPPFLAGS= -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CPPFLAGS@
AR = @AR@
RANLIB = @RANLIB@
@@ -25,6 +26,11 @@ ${LIB}: ${OBJS}
${AR} cr $@ ${OBJS}
${RANLIB} $@
+${OBJS}: ${srcdir}/../tnftp.h ../config.h
+
+.c.o:
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
+
install:
clean:
diff --git a/net/tnftp/files/libedit/chared.c b/net/tnftp/files/libedit/chared.c
index 23adb5fb9c0..d15a53ba2f1 100644
--- a/net/tnftp/files/libedit/chared.c
+++ b/net/tnftp/files/libedit/chared.c
@@ -1,4 +1,4 @@
-/* NetBSD: chared.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: chared.c,v 1.6 2005/06/09 16:48:57 lukem Exp */
/* from NetBSD: chared.c,v 1.22 2004/08/13 12:10:38 mycroft Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: chared.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* chared.c: Character editor utilities
*/
@@ -64,7 +53,7 @@ cv_undo(EditLine *el)
{
c_undo_t *vu = &el->el_chared.c_undo;
c_redo_t *r = &el->el_chared.c_redo;
- uint size;
+ unsigned int size;
/* Save entire line for undo */
size = el->el_line.lastchar - el->el_line.buffer;
diff --git a/net/tnftp/files/libedit/common.c b/net/tnftp/files/libedit/common.c
index 3344c3ebaa8..eac356805ed 100644
--- a/net/tnftp/files/libedit/common.c
+++ b/net/tnftp/files/libedit/common.c
@@ -1,4 +1,4 @@
-/* NetBSD: common.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: common.c,v 1.5 2005/06/09 16:48:57 lukem Exp */
/* from NetBSD: common.c,v 1.16 2003/08/07 16:44:30 agc Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)common.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: common.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* common.c: Common Editor functions
*/
diff --git a/net/tnftp/files/libedit/editline.3 b/net/tnftp/files/libedit/editline.3
index 7ed7c5bf977..cf5ff894067 100644
--- a/net/tnftp/files/libedit/editline.3
+++ b/net/tnftp/files/libedit/editline.3
@@ -1,5 +1,5 @@
-.\" NetBSD: editline.3,v 1.2 2005/05/11 01:17:39 lukem Exp
-.\" from NetBSD: editline.3,v 1.45 2004/04/15 08:13:29 wiz Exp
+.\" NetBSD: editline.3,v 1.3 2005/05/31 02:07:02 lukem Exp
+.\" from NetBSD: editline.3,v 1.46 2005/03/19 17:36:02 christos Exp
.\"
.\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -34,7 +34,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 5, 2003
+.Dd March 19, 2005
.Os
.Dt EDITLINE 3
.Sh NAME
@@ -106,9 +106,9 @@
.Ft void
.Fn tok_reset "Tokenizer *t"
.Ft int
-.Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char *argv[]" "int *cursorc" "int *cursoro"
+.Fn tok_line "Tokenizer *t" "const LineInfo *li" "int *argc" "const char **argv[]" "int *cursorc" "int *cursoro"
.Ft int
-.Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char *argv[]"
+.Fn tok_str "Tokenizer *t" "const char *str" "int *argc" "const char **argv[]"
.Sh DESCRIPTION
The
.Nm
diff --git a/net/tnftp/files/libedit/el.c b/net/tnftp/files/libedit/el.c
index f6d819a07a0..99084110bd1 100644
--- a/net/tnftp/files/libedit/el.c
+++ b/net/tnftp/files/libedit/el.c
@@ -1,4 +1,4 @@
-/* NetBSD: el.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: el.c,v 1.5 2005/06/09 16:48:57 lukem Exp */
/* from NetBSD: el.c,v 1.39 2004/07/08 00:51:36 christos Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
-#else
-__RCSID("NetBSD: el.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* el.c: EditLine interface functions
*/
diff --git a/net/tnftp/files/libedit/emacs.c b/net/tnftp/files/libedit/emacs.c
index 39bcced6f0d..55d949b8322 100644
--- a/net/tnftp/files/libedit/emacs.c
+++ b/net/tnftp/files/libedit/emacs.c
@@ -1,4 +1,4 @@
-/* NetBSD: emacs.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: emacs.c,v 1.5 2005/06/09 16:48:57 lukem Exp */
/* from NetBSD: emacs.c,v 1.19 2004/10/28 21:14:52 dsl Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)emacs.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: emacs.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* emacs.c: Emacs functions
*/
diff --git a/net/tnftp/files/libedit/hist.c b/net/tnftp/files/libedit/hist.c
index 55adb3542aa..5193c8f209d 100644
--- a/net/tnftp/files/libedit/hist.c
+++ b/net/tnftp/files/libedit/hist.c
@@ -1,4 +1,4 @@
-/* NetBSD: hist.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: hist.c,v 1.5 2005/06/09 16:48:57 lukem Exp */
/* from NetBSD: hist.c,v 1.15 2003/11/01 23:36:39 christos Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: hist.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* hist.c: History access functions
*/
diff --git a/net/tnftp/files/libedit/histedit.h b/net/tnftp/files/libedit/histedit.h
index d984dd1e904..3251fe2c356 100644
--- a/net/tnftp/files/libedit/histedit.h
+++ b/net/tnftp/files/libedit/histedit.h
@@ -1,5 +1,5 @@
-/* NetBSD: histedit.h,v 1.2 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: histedit.h,v 1.25 2003/12/05 13:37:48 lukem Exp */
+/* NetBSD: histedit.h,v 1.3 2005/05/31 02:07:02 lukem Exp */
+/* from NetBSD: histedit.h,v 1.26 2005/05/07 16:01:25 dsl Exp */
/*-
* Copyright (c) 1992, 1993
@@ -107,6 +107,7 @@ int el_parse(EditLine *, int, const char **);
*/
int el_set(EditLine *, int, ...);
int el_get(EditLine *, int, void *);
+unsigned char _el_fn_complete(EditLine *, int);
/*
* el_set/el_get parameters
diff --git a/net/tnftp/files/libedit/history.c b/net/tnftp/files/libedit/history.c
index c88439d4483..ace82b0ff6f 100644
--- a/net/tnftp/files/libedit/history.c
+++ b/net/tnftp/files/libedit/history.c
@@ -1,4 +1,4 @@
-/* NetBSD: history.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: history.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: history.c,v 1.28 2004/11/27 18:31:45 christos Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: history.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* hist.c: History access functions
*/
diff --git a/net/tnftp/files/libedit/key.c b/net/tnftp/files/libedit/key.c
index 2babd0067bf..9ed2d7e1d93 100644
--- a/net/tnftp/files/libedit/key.c
+++ b/net/tnftp/files/libedit/key.c
@@ -1,4 +1,4 @@
-/* NetBSD: key.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: key.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: key.c,v 1.15 2003/10/18 23:48:42 christos Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: key.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* key.c: This module contains the procedures for maintaining
* the extended-key map.
diff --git a/net/tnftp/files/libedit/map.c b/net/tnftp/files/libedit/map.c
index 584aaf15255..97ef66fb2e5 100644
--- a/net/tnftp/files/libedit/map.c
+++ b/net/tnftp/files/libedit/map.c
@@ -1,4 +1,4 @@
-/* NetBSD: map.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: map.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: map.c,v 1.20 2004/08/13 12:10:39 mycroft Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: map.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* map.c: Editor function definitions
*/
diff --git a/net/tnftp/files/libedit/parse.c b/net/tnftp/files/libedit/parse.c
index 385b468ff23..75f2bbbd824 100644
--- a/net/tnftp/files/libedit/parse.c
+++ b/net/tnftp/files/libedit/parse.c
@@ -1,5 +1,5 @@
-/* NetBSD: parse.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: parse.c,v 1.20 2003/12/05 13:37:48 lukem Exp */
+/* NetBSD: parse.c,v 1.6 2005/06/09 16:48:58 lukem Exp */
+/* from NetBSD: parse.c,v 1.22 2005/05/29 04:58:15 lukem Exp */
/*-
* Copyright (c) 1992, 1993
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: parse.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* parse.c: parse an editline extended command
*
@@ -142,7 +131,7 @@ el_parse(EditLine *el, int argc, const char *argv[])
* the appropriate character or -1 if the escape is not valid
*/
protected int
-parse__escape(const char **const ptr)
+parse__escape(const char **ptr)
{
const char *p;
int c;
diff --git a/net/tnftp/files/libedit/parse.h b/net/tnftp/files/libedit/parse.h
index 64da41c0977..4c1c456a82e 100644
--- a/net/tnftp/files/libedit/parse.h
+++ b/net/tnftp/files/libedit/parse.h
@@ -1,5 +1,5 @@
-/* NetBSD: parse.h,v 1.2 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: parse.h,v 1.5 2003/08/07 16:44:32 agc Exp */
+/* NetBSD: parse.h,v 1.3 2005/05/31 02:07:02 lukem Exp */
+/* from NetBSD: parse.h,v 1.6 2005/05/29 04:58:15 lukem Exp */
/*-
* Copyright (c) 1992, 1993
@@ -42,7 +42,7 @@
#define _h_el_parse
protected int parse_line(EditLine *, const char *);
-protected int parse__escape(const char ** const);
+protected int parse__escape(const char **);
protected char *parse__string(char *, const char *);
protected int parse_cmd(EditLine *, const char *);
diff --git a/net/tnftp/files/libedit/prompt.c b/net/tnftp/files/libedit/prompt.c
index 6814ed81388..20af922fd39 100644
--- a/net/tnftp/files/libedit/prompt.c
+++ b/net/tnftp/files/libedit/prompt.c
@@ -1,4 +1,4 @@
-/* NetBSD: prompt.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: prompt.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: prompt.c,v 1.11 2003/08/07 16:44:32 agc Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: prompt.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* prompt.c: Prompt printing functions
*/
diff --git a/net/tnftp/files/libedit/read.c b/net/tnftp/files/libedit/read.c
index f8b8535844e..4ae25057f6c 100644
--- a/net/tnftp/files/libedit/read.c
+++ b/net/tnftp/files/libedit/read.c
@@ -1,5 +1,5 @@
-/* NetBSD: read.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: read.c,v 1.34 2004/07/08 00:51:36 christos Exp */
+/* NetBSD: read.c,v 1.7 2005/06/09 16:48:58 lukem Exp */
+/* from NetBSD: read.c,v 1.35 2005/03/09 23:55:02 christos Exp */
/*-
* Copyright (c) 1992, 1993
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: read.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* read.c: Clean this junk up! This is horrible code.
* Terminal read functions
@@ -372,6 +361,9 @@ read_prepare(EditLine *el)
re_clear_display(el); /* reset the display stuff */
ch_reset(el);
re_refresh(el); /* print the prompt */
+
+ if (el->el_flags & UNBUFFERED)
+ term__flush();
}
protected void
@@ -488,7 +480,7 @@ el_gets(EditLine *el, int *nread)
#endif /* DEBUG_READ */
break;
}
- if ((uint)cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */
+ if ((unsigned int)cmdnum >= el->el_map.nfunc) { /* BUG CHECK command */
#ifdef DEBUG_EDIT
(void) fprintf(el->el_errfile,
"ERROR: illegal command from key 0%o\r\n", ch);
diff --git a/net/tnftp/files/libedit/readline/readline.h b/net/tnftp/files/libedit/readline/readline.h
index 3790a4a9a92..78606d9cf4e 100644
--- a/net/tnftp/files/libedit/readline/readline.h
+++ b/net/tnftp/files/libedit/readline/readline.h
@@ -1,5 +1,5 @@
-/* NetBSD: readline.h,v 1.2 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: readline.h,v 1.12 2004/09/08 18:15:37 christos Exp */
+/* NetBSD: readline.h,v 1.3 2005/05/31 02:07:02 lukem Exp */
+/* from NetBSD: readline.h,v 1.14 2005/05/27 11:35:07 agc Exp */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -46,6 +46,7 @@
/* typedefs */
typedef int Function(const char *, int);
typedef void VFunction(void);
+typedef void VCPFunction(char *);
typedef char *CPFunction(const char *, int);
typedef char **CPPFunction(const char *, int, int);
@@ -103,6 +104,7 @@ extern char *rl_completer_word_break_characters;
extern char *rl_completer_quote_characters;
extern Function *rl_completion_entry_function;
extern CPPFunction *rl_attempted_completion_function;
+extern int rl_attempted_completion_over;
extern int rl_completion_type;
extern int rl_completion_query_items;
extern char *rl_special_prefixes;
@@ -167,7 +169,7 @@ void rl_reset_terminal(const char *);
int rl_bind_key(int, int (*)(int, int));
int rl_newline(int, int);
void rl_callback_read_char(void);
-void rl_callback_handler_install(const char *, VFunction *);
+void rl_callback_handler_install(const char *, VCPFunction *);
void rl_callback_handler_remove(void);
void rl_redisplay(void);
int rl_get_previous_history(int, int);
@@ -175,6 +177,7 @@ void rl_prep_terminal(int);
void rl_deprep_terminal(void);
int rl_read_init_file(const char *);
int rl_parse_and_bind(const char *);
+int rl_variable_bind(const char *, const char *);
void rl_stuff_char(int);
int rl_add_defun(const char *, Function *, int);
diff --git a/net/tnftp/files/libedit/refresh.c b/net/tnftp/files/libedit/refresh.c
index c8f5799dc56..ea44c7e1461 100644
--- a/net/tnftp/files/libedit/refresh.c
+++ b/net/tnftp/files/libedit/refresh.c
@@ -1,4 +1,4 @@
-/* NetBSD: refresh.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: refresh.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: refresh.c,v 1.26 2003/08/07 16:44:33 agc Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: refresh.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* refresh.c: Lower level screen refreshing functions
*/
diff --git a/net/tnftp/files/libedit/search.c b/net/tnftp/files/libedit/search.c
index cbe7b9cf2dd..27bc7e6b174 100644
--- a/net/tnftp/files/libedit/search.c
+++ b/net/tnftp/files/libedit/search.c
@@ -1,4 +1,4 @@
-/* NetBSD: search.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: search.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: search.c,v 1.20 2004/11/04 01:16:03 christos Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: search.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* search.c: History and character search functions
*/
diff --git a/net/tnftp/files/libedit/sig.c b/net/tnftp/files/libedit/sig.c
index c9af37da1fb..a134612ef9e 100644
--- a/net/tnftp/files/libedit/sig.c
+++ b/net/tnftp/files/libedit/sig.c
@@ -1,4 +1,4 @@
-/* NetBSD: sig.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: sig.c,v 1.6 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: sig.c,v 1.11 2003/08/07 16:44:33 agc Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: sig.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* sig.c: Signal handling stuff.
* our policy is to trap all signals, set a good state
@@ -55,6 +44,8 @@ __RCSID("NetBSD: sig.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
#include "el.h"
#include <stdlib.h>
+#include "src/progressbar.h" /* for xsignal_restart() */
+
private EditLine *sel = NULL;
private const int sighdl[] = {
diff --git a/net/tnftp/files/libedit/sys.h b/net/tnftp/files/libedit/sys.h
index 6d33e798884..f5fe7c5936a 100644
--- a/net/tnftp/files/libedit/sys.h
+++ b/net/tnftp/files/libedit/sys.h
@@ -1,4 +1,4 @@
-/* NetBSD: sys.h,v 1.3 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: sys.h,v 1.4 2005/05/27 04:58:05 lukem Exp */
/* from NetBSD: sys.h,v 1.9 2004/01/17 17:57:40 christos Exp */
/*-
@@ -41,15 +41,11 @@
#ifndef _h_sys
#define _h_sys
-#if __not_for_tnftp
-#ifdef HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
# define __attribute__(A)
#endif
+#if __not_for_tnftp
#ifndef __BEGIN_DECLS
# ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
diff --git a/net/tnftp/files/libedit/term.c b/net/tnftp/files/libedit/term.c
index e722b8870c3..b1a3ba2921b 100644
--- a/net/tnftp/files/libedit/term.c
+++ b/net/tnftp/files/libedit/term.c
@@ -1,4 +1,4 @@
-/* NetBSD: term.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: term.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: term.c,v 1.40 2004/05/22 23:21:28 christos Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
-#else
-__RCSID("NetBSD: term.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* term.c: Editor/termcap-curses interface
* We have to declare a static variable here, since the
diff --git a/net/tnftp/files/libedit/term.h b/net/tnftp/files/libedit/term.h
index 250a923b8fb..49f8ec5affb 100644
--- a/net/tnftp/files/libedit/term.h
+++ b/net/tnftp/files/libedit/term.h
@@ -1,5 +1,5 @@
-/* NetBSD: term.h,v 1.2 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: term.h,v 1.15 2003/09/14 21:48:55 christos Exp */
+/* NetBSD: term.h,v 1.3 2005/05/31 02:07:02 lukem Exp */
+/* from NetBSD: term.h,v 1.16 2005/03/15 00:10:40 christos Exp */
/*-
* Copyright (c) 1992, 1993
@@ -116,6 +116,7 @@ protected void term__flush(void);
#define EL_CAN_CEOL (EL_FLAGS & TERM_CAN_CEOL)
#define EL_CAN_TAB (EL_FLAGS & TERM_CAN_TAB)
#define EL_CAN_ME (EL_FLAGS & TERM_CAN_ME)
+#define EL_CAN_UP (EL_FLAGS & TERM_CAN_UP)
#define EL_HAS_META (EL_FLAGS & TERM_HAS_META)
#define EL_HAS_AUTO_MARGINS (EL_FLAGS & TERM_HAS_AUTO_MARGINS)
#define EL_HAS_MAGIC_MARGINS (EL_FLAGS & TERM_HAS_MAGIC_MARGINS)
diff --git a/net/tnftp/files/libedit/tokenizer.c b/net/tnftp/files/libedit/tokenizer.c
index a773bc5c358..096b0e556e9 100644
--- a/net/tnftp/files/libedit/tokenizer.c
+++ b/net/tnftp/files/libedit/tokenizer.c
@@ -1,4 +1,4 @@
-/* NetBSD: tokenizer.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: tokenizer.c,v 1.5 2005/06/09 16:48:58 lukem Exp */
/* from NetBSD: tokenizer.c,v 1.14 2003/12/05 13:37:48 lukem Exp */
/*-
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: tokenizer.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* tokenize.c: Bourne shell like tokenizer
*/
diff --git a/net/tnftp/files/libedit/tty.c b/net/tnftp/files/libedit/tty.c
index a60929980a0..23acd59aff0 100644
--- a/net/tnftp/files/libedit/tty.c
+++ b/net/tnftp/files/libedit/tty.c
@@ -1,5 +1,5 @@
-/* NetBSD: tty.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: tty.c,v 1.21 2004/08/13 12:10:39 mycroft Exp */
+/* NetBSD: tty.c,v 1.7 2005/06/09 16:48:58 lukem Exp */
+/* from NetBSD: tty.c,v 1.22 2005/05/29 03:55:37 christos Exp */
/*-
* Copyright (c) 1992, 1993
@@ -36,17 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: tty.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* tty.c: tty interface stuff
*/
@@ -56,7 +45,7 @@ __RCSID("NetBSD: tty.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
typedef struct ttymodes_t {
const char *m_name;
- u_int m_value;
+ unsigned int m_value;
int m_type;
} ttymodes_t;
@@ -1234,7 +1223,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
return (0);
}
while (argv && (s = *argv++)) {
- char *p;
+ const char *p;
switch (*s) {
case '+':
case '-':
@@ -1245,10 +1234,10 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
break;
}
d = s;
- if ((p = strchr(s, '=')) != NULL)
- *p++ = '\0';
+ p = strchr(s, '=');
for (m = ttymodes; m->m_name; m++)
- if (strcmp(m->m_name, d) == 0 &&
+ if ((p ? strncmp(m->m_name, d, (size_t)(p - d)) :
+ strcmp(m->m_name, d)) == 0 &&
(p == NULL || m->m_type == MD_CHAR))
break;
@@ -1259,7 +1248,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)), const char **argv)
}
if (p) {
int c = ffs((int)m->m_value);
- int v = *p ? parse__escape((const char **const) &p) :
+ int v = *++p ? parse__escape((const char **) &p) :
el->el_tty.t_vdisable;
assert(c-- != 0);
c = tty__getcharindex(c);
diff --git a/net/tnftp/files/libedit/tty.h b/net/tnftp/files/libedit/tty.h
index 8af3d1682b1..f3d92f8f593 100644
--- a/net/tnftp/files/libedit/tty.h
+++ b/net/tnftp/files/libedit/tty.h
@@ -1,4 +1,4 @@
-/* NetBSD: tty.h,v 1.2 2005/05/11 01:17:39 lukem Exp */
+/* NetBSD: tty.h,v 1.3 2005/06/01 11:42:24 lukem Exp */
/* from NetBSD: tty.h,v 1.10 2003/08/07 16:44:34 agc Exp */
/*-
@@ -451,8 +451,8 @@
typedef struct {
const char *t_name;
- u_int t_setmask;
- u_int t_clrmask;
+ unsigned int t_setmask;
+ unsigned int t_clrmask;
} ttyperm_t[NN_IO][MD_NN];
typedef unsigned char ttychar_t[NN_IO][C_NCC];
diff --git a/net/tnftp/files/libedit/vi.c b/net/tnftp/files/libedit/vi.c
index 23db282ea1a..98e6b9309bc 100644
--- a/net/tnftp/files/libedit/vi.c
+++ b/net/tnftp/files/libedit/vi.c
@@ -1,5 +1,5 @@
-/* NetBSD: vi.c,v 1.4 2005/05/11 01:17:39 lukem Exp */
-/* from NetBSD: vi.c,v 1.20 2004/08/13 12:10:39 mycroft Exp */
+/* NetBSD: vi.c,v 1.6 2005/06/09 16:48:58 lukem Exp */
+/* from NetBSD: vi.c,v 1.21 2005/04/25 01:06:03 matt Exp */
/*-
* Copyright (c) 1992, 1993
@@ -36,21 +36,6 @@
#include "tnftp.h"
#include "sys.h"
-#if 0
-#include "config.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/wait.h>
-
-#if !defined(lint) && !defined(SCCSID)
-#if 0
-static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("NetBSD: vi.c,v 1.4 2005/05/11 01:17:39 lukem Exp");
-#endif
-#endif /* not lint && not SCCSID */
-#endif
-
/*
* vi.c: Vi mode commands.
*/
@@ -1027,7 +1012,7 @@ vi_histedit(EditLine *el, int c)
return CC_ERROR;
case 0:
close(fd);
- execlp("vi", "vi", tempfile, 0);
+ execlp("vi", "vi", tempfile, NULL);
exit(0);
/*NOTREACHED*/
default:
diff --git a/net/tnftp/files/libnetbsd/Makefile.in b/net/tnftp/files/libnetbsd/Makefile.in
index ee8661b3bf8..7cc3d64d5b2 100644
--- a/net/tnftp/files/libnetbsd/Makefile.in
+++ b/net/tnftp/files/libnetbsd/Makefile.in
@@ -1,4 +1,4 @@
-# NetBSD: Makefile.in,v 1.3 2005/05/11 01:01:56 lukem Exp
+# NetBSD: Makefile.in,v 1.5 2005/06/10 04:36:12 lukem Exp
#
srcdir = @srcdir@
@@ -6,7 +6,8 @@ VPATH = @srcdir@
SHELL = /bin/sh
CC = @CC@
-CFLAGS = -I${srcdir} -I${srcdir}/.. -I.. @INCLUDES@ @CFLAGS@
+CFLAGS = @CFLAGS@
+CPPFLAGS= -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CPPFLAGS@
AR = @AR@
RANLIB = @RANLIB@
@@ -22,6 +23,11 @@ ${LIB}: ${OBJS}
${AR} cr $@ ${OBJS}
${RANLIB} $@
+${OBJS}: ${srcdir}/../tnftp.h ../config.h
+
+.c.o:
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
+
install:
clean:
diff --git a/net/tnftp/files/libnetbsd/ftpglob.h b/net/tnftp/files/libnetbsd/ftpglob.h
index 5c59a6e5423..044dad5c22f 100644
--- a/net/tnftp/files/libnetbsd/ftpglob.h
+++ b/net/tnftp/files/libnetbsd/ftpglob.h
@@ -1,5 +1,5 @@
-/* NetBSD: ftpglob.h,v 1.2 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: glob.h,v 1.13 2001/03/16 21:02:42 christos Exp */
+/* NetBSD: ftpglob.h,v 1.3 2005/05/16 05:45:40 lukem Exp */
+/* from NetBSD: glob.h,v 1.19 2005/02/03 04:39:32 perry Exp */
/*
* Copyright (c) 1989, 1993
@@ -16,11 +16,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/net/tnftp/files/libnetbsd/ftpvis.h b/net/tnftp/files/libnetbsd/ftpvis.h
index c13a27f9f53..acb1b4e3bc2 100644
--- a/net/tnftp/files/libnetbsd/ftpvis.h
+++ b/net/tnftp/files/libnetbsd/ftpvis.h
@@ -1,5 +1,5 @@
-/* NetBSD: ftpvis.h,v 1.2 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: vis.h,v 1.10 1998/11/13 12:20:18 christos Exp */
+/* NetBSD: ftpvis.h,v 1.3 2005/05/16 13:25:48 lukem Exp */
+/* from NetBSD: vis.h,v 1.15 2005/02/03 04:39:32 perry Exp */
/*-
* Copyright (c) 1990, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -59,6 +55,7 @@
* other
*/
#define VIS_NOSLASH 0x40 /* inhibit printing '\' */
+#define VIS_HTTPSTYLE 0x80 /* http-style escape % HEX HEX */
/*
* unvis return codes
@@ -75,9 +72,13 @@
#define UNVIS_END 1 /* no more characters */
char *vis(char *, int, int, int);
+char *svis(char *, int, int, int, const char *);
int strvis(char *, const char *, int);
+int strsvis(char *, const char *, int, const char *);
int strvisx(char *, const char *, size_t, int);
+int strsvisx(char *, const char *, size_t, int, const char *);
int strunvis(char *, const char *);
+int strunvisx(char *, const char *, int);
int unvis(char *, int, int *, int);
#endif /* !_VIS_H_ */
diff --git a/net/tnftp/files/libnetbsd/getnameinfo.c b/net/tnftp/files/libnetbsd/getnameinfo.c
index c49f7fc143b..897f4ce068e 100644
--- a/net/tnftp/files/libnetbsd/getnameinfo.c
+++ b/net/tnftp/files/libnetbsd/getnameinfo.c
@@ -1,4 +1,4 @@
-/* NetBSD: getnameinfo.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
+/* NetBSD: getnameinfo.c,v 1.5 2005/06/01 11:48:49 lukem Exp */
/* from ? */
/*
@@ -67,9 +67,9 @@ static struct afd {
};
struct sockinet {
- u_char si_len;
- u_char si_family;
- u_short si_port;
+ unsigned char si_len;
+ unsigned char si_family;
+ unsigned short si_port;
};
#ifdef INET6
@@ -87,13 +87,13 @@ static int ip6_sa2str(const struct sockaddr_in6 *, char *, size_t, int);
#define ENI_SALEN EAI_FAMILY
int
-getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host,
- size_t hostlen, char *serv, size_t servlen, int flags)
+getnameinfo(const struct sockaddr *sa, socklen_t salen,
+ char *host, size_t hostlen, char *serv, size_t servlen, int flags)
{
struct afd *afd;
struct servent *sp;
struct hostent *hp;
- u_short port;
+ unsigned short port;
int family, i;
const char *addr;
unsigned int v4a;
diff --git a/net/tnftp/files/libnetbsd/glob.c b/net/tnftp/files/libnetbsd/glob.c
index 26ec800729f..c2635cb7841 100644
--- a/net/tnftp/files/libnetbsd/glob.c
+++ b/net/tnftp/files/libnetbsd/glob.c
@@ -1,5 +1,5 @@
-/* NetBSD: glob.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: __glob13.c,v 1.23 2001/09/18 16:37:26 christos Exp */
+/* NetBSD: glob.c,v 1.5 2005/06/01 11:48:49 lukem Exp */
+/* from NetBSD: __glob13.c,v 1.25 2003/08/07 16:42:45 agc Exp */
/*
* Copyright (c) 1989, 1993
@@ -16,11 +16,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -88,7 +84,7 @@
#define M_MASK 0xffff
#define M_ASCII 0x00ff
-typedef u_short Char;
+typedef unsigned short Char;
#else
@@ -137,11 +133,11 @@ int
glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
glob_t *pglob)
{
- const u_char *patnext;
+ const unsigned char *patnext;
int c;
Char *bufnext, *bufend, patbuf[MAXPATHLEN+1];
- patnext = (const u_char *) pattern;
+ patnext = (const unsigned char *) pattern;
if (!(flags & GLOB_APPEND)) {
pglob->gl_pathc = 0;
pglob->gl_pathv = NULL;
@@ -616,7 +612,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pathlim,
else
readdirfunc = (struct dirent *(*)(void *)) readdir;
while ((dp = (*readdirfunc)(dirp)) != NULL) {
- u_char *sc;
+ unsigned char *sc;
Char *dc;
/* Initial DOT must be matched literally. */
@@ -626,7 +622,7 @@ glob3(Char *pathbuf, Char *pathend, Char *pathlim,
* The resulting string contains EOS, so we can
* use the pathlim character, if it is the nul
*/
- for (sc = (u_char *) dp->d_name, dc = pathend;
+ for (sc = (unsigned char *) dp->d_name, dc = pathend;
dc <= pathlim && (*dc++ = *sc++) != EOS;)
continue;
@@ -806,7 +802,7 @@ g_opendir(Char *str, glob_t *pglob)
char buf[MAXPATHLEN];
if (!*str)
- (void)strcpy(buf, ".");
+ (void)strlcpy(buf, ".", sizeof(buf));
else {
if (g_Ctoc(str, buf, sizeof(buf)))
return NULL;
diff --git a/net/tnftp/files/libnetbsd/inet_ntop.c b/net/tnftp/files/libnetbsd/inet_ntop.c
index a7b27bd4ad7..ac2fde52109 100644
--- a/net/tnftp/files/libnetbsd/inet_ntop.c
+++ b/net/tnftp/files/libnetbsd/inet_ntop.c
@@ -1,20 +1,21 @@
-/* NetBSD: inet_ntop.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: inet_ntop.c,v 1.9 2000/01/22 22:19:16 mycroft Exp */
+/* NetBSD: inet_ntop.c,v 1.6 2005/06/01 11:48:49 lukem Exp */
+/* from NetBSD: inet_ntop.c,v 1.2 2004/05/20 23:12:33 christos Exp */
-/* Copyright (c) 1996 by Internet Software Consortium.
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "tnftp.h"
@@ -23,18 +24,12 @@
#include <arpa/nameser.h>
#endif
-#ifndef IN6ADDRSZ
-#define IN6ADDRSZ 16
-#endif
-
-#ifndef INT16SZ
-#define INT16SZ 2
+#ifndef NS_IN6ADDRSZ
+#define NS_IN6ADDRSZ 16
#endif
-#ifdef SPRINTF_CHAR
-# define SPRINTF(x) strlen(sprintf/**/x)
-#else
-# define SPRINTF(x) ((size_t)sprintf x)
+#ifndef NS_INT16SZ
+#define NS_INT16SZ 2
#endif
/*
@@ -42,8 +37,8 @@
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
-static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
-static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
+static const char *inet_ntop4(const unsigned char *src, char *dst, socklen_t size);
+static const char *inet_ntop6(const unsigned char *src, char *dst, socklen_t size);
/* char *
* inet_ntop(af, src, dst, size)
@@ -54,7 +49,7 @@ static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
* Paul Vixie, 1996.
*/
const char *
-inet_ntop(int af, const void *src, char *dst, size_t size)
+inet_ntop(int af, const void *src, char *dst, socklen_t size)
{
switch (af) {
@@ -78,21 +73,23 @@ inet_ntop(int af, const void *src, char *dst, size_t size)
* `dst' (as a const)
* notes:
* (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
+ * (2) takes a unsigned char* not an in_addr as input
* author:
* Paul Vixie, 1996.
*/
static const char *
-inet_ntop4(const u_char *src, char *dst, size_t size)
+inet_ntop4(const unsigned char *src, char *dst, socklen_t size)
{
- static const char fmt[] = "%u.%u.%u.%u";
char tmp[sizeof "255.255.255.255"];
+ int l;
- if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
+ l = snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
+ src[0], src[1], src[2], src[3]);
+ if (l <= 0 || (socklen_t) l >= size) {
errno = ENOSPC;
return (NULL);
}
- strcpy(dst, tmp);
+ strlcpy(dst, tmp, size);
return (dst);
}
@@ -104,7 +101,7 @@ inet_ntop4(const u_char *src, char *dst, size_t size)
* Paul Vixie, 1996.
*/
static const char *
-inet_ntop6(const u_char *src, char *dst, size_t size)
+inet_ntop6(const unsigned char *src, char *dst, socklen_t size)
{
/*
* Note that int32_t and int16_t need only be "at least" large enough
@@ -113,10 +110,12 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+ char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
+ char *tp, *ep;
struct { int base, len; } best, cur;
- u_int words[IN6ADDRSZ / INT16SZ];
+ unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
int i;
+ int advance;
/*
* Preprocess:
@@ -124,11 +123,11 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
memset(words, '\0', sizeof words);
- for (i = 0; i < IN6ADDRSZ; i++)
+ for (i = 0; i < NS_IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
best.base = -1;
cur.base = -1;
- for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
if (words[i] == 0) {
if (cur.base == -1)
cur.base = i, cur.len = 1;
@@ -153,7 +152,8 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
* Format the result.
*/
tp = tmp;
- for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+ ep = tmp + sizeof(tmp);
+ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) {
/* Are we inside the best run of 0x00's? */
if (best.base != -1 && i >= best.base &&
i < (best.base + best.len)) {
@@ -162,21 +162,35 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
continue;
}
/* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
+ if (i != 0) {
+ if (tp + 1 >= ep)
+ return (NULL);
*tp++ = ':';
+ }
/* Is this address an encapsulated IPv4? */
if (i == 6 && best.base == 0 &&
- (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+ (best.len == 6 ||
+ (best.len == 7 && words[7] != 0x0001) ||
+ (best.len == 5 && words[5] == 0xffff))) {
+ if (!inet_ntop4(src+12, tp, (socklen_t)(ep - tp)))
return (NULL);
tp += strlen(tp);
break;
}
- tp += SPRINTF((tp, "%x", words[i]));
+ advance = snprintf(tp, (size_t)(ep - tp), "%x", words[i]);
+ if (advance <= 0 || advance >= ep - tp)
+ return (NULL);
+ tp += advance;
}
/* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
+ if (best.base != -1 && (best.base + best.len) ==
+ (NS_IN6ADDRSZ / NS_INT16SZ)) {
+ if (tp + 1 >= ep)
+ return (NULL);
*tp++ = ':';
+ }
+ if (tp + 1 >= ep)
+ return (NULL);
*tp++ = '\0';
/*
@@ -186,7 +200,7 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
errno = ENOSPC;
return (NULL);
}
- strcpy(dst, tmp);
+ strlcpy(dst, tmp, size);
return (dst);
}
#endif
diff --git a/net/tnftp/files/libnetbsd/inet_pton.c b/net/tnftp/files/libnetbsd/inet_pton.c
index ea846b48e23..9072c48a405 100644
--- a/net/tnftp/files/libnetbsd/inet_pton.c
+++ b/net/tnftp/files/libnetbsd/inet_pton.c
@@ -1,20 +1,21 @@
-/* NetBSD: inet_pton.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: inet_pton.c,v 1.16 2000/02/07 18:51:02 itojun Exp */
+/* NetBSD: inet_pton.c,v 1.5 2005/06/01 11:48:49 lukem Exp */
+/* from NetBSD: inet_pton.c,v 1.2 2004/05/20 23:12:33 christos Exp */
-/* Copyright (c) 1996 by Internet Software Consortium.
+/*
+ * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "tnftp.h"
@@ -23,8 +24,16 @@
#include <arpa/nameser.h>
#endif
-#ifndef INADDRSZ
-#define INADDRSZ 4
+#ifndef NS_INADDRSZ
+#define NS_INADDRSZ 4
+#endif
+
+#ifndef NS_IN6ADDRSZ
+#define NS_IN6ADDRSZ 16
+#endif
+
+#ifndef NS_INT16SZ
+#define NS_INT16SZ 2
#endif
/*
@@ -32,9 +41,9 @@
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
*/
-static int inet_pton4(const char *src, u_char *dst, int pton);
+static int inet_pton4(const char *src, unsigned char *dst, int pton);
#ifdef INET6
-static int inet_pton6(const char *src, u_char *dst);
+static int inet_pton6(const char *src, unsigned char *dst);
#endif
/* int
@@ -78,14 +87,14 @@ inet_pton(int af, const char *src, void *dst)
* Paul Vixie, 1996.
*/
static int
-inet_pton4(const char *src, u_char *dst, int pton)
+inet_pton4(const char *src, unsigned char *dst, int pton)
{
- u_int val;
- u_int digit;
- int base, n;
+ uint32_t val;
+ unsigned int digit, base;
+ int n;
unsigned char c;
- u_int parts[4];
- register u_int *pp = parts;
+ unsigned int parts[4];
+ unsigned int *pp = parts;
c = *src;
for (;;) {
@@ -179,7 +188,7 @@ inet_pton4(const char *src, u_char *dst, int pton)
}
if (dst) {
val = htonl(val);
- memcpy(dst, &val, INADDRSZ);
+ memcpy(dst, &val, NS_INADDRSZ);
}
return (1);
}
@@ -199,17 +208,17 @@ inet_pton4(const char *src, u_char *dst, int pton)
* Paul Vixie, 1996.
*/
static int
-inet_pton6(const char *src, u_char *dst)
+inet_pton6(const char *src, unsigned char *dst)
{
static const char xdigits_l[] = "0123456789abcdef",
xdigits_u[] = "0123456789ABCDEF";
- u_char tmp[IN6ADDRSZ], *tp, *endp, *colonp;
+ unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
const char *xdigits, *curtok;
int ch, saw_xdigit;
- u_int val;
+ unsigned int val;
- memset((tp = tmp), '\0', IN6ADDRSZ);
- endp = tp + IN6ADDRSZ;
+ memset((tp = tmp), '\0', NS_IN6ADDRSZ);
+ endp = tp + NS_IN6ADDRSZ;
colonp = NULL;
/* Leading :: requires some special handling. */
if (*src == ':')
@@ -242,25 +251,25 @@ inet_pton6(const char *src, u_char *dst)
return (0);
if (tp + INT16SZ > endp)
return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
+ *tp++ = (unsigned char) (val >> 8) & 0xff;
+ *tp++ = (unsigned char) val & 0xff;
saw_xdigit = 0;
val = 0;
continue;
}
- if (ch == '.' && ((tp + INADDRSZ) <= endp) &&
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
inet_pton4(curtok, tp, 1) > 0) {
- tp += INADDRSZ;
+ tp += NS_INADDRSZ;
saw_xdigit = 0;
break; /* '\0' was seen by inet_pton4(). */
}
return (0);
}
if (saw_xdigit) {
- if (tp + INT16SZ > endp)
+ if (tp + NS_INT16SZ > endp)
return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
+ *tp++ = (unsigned char) (val >> 8) & 0xff;
+ *tp++ = (unsigned char) val & 0xff;
}
if (colonp != NULL) {
/*
@@ -280,7 +289,7 @@ inet_pton6(const char *src, u_char *dst)
}
if (tp != endp)
return (0);
- memcpy(dst, tmp, IN6ADDRSZ);
+ memcpy(dst, tmp, NS_IN6ADDRSZ);
return (1);
}
#endif
diff --git a/net/tnftp/files/libnetbsd/mkstemp.c b/net/tnftp/files/libnetbsd/mkstemp.c
index 2941a14f0f9..d1b40ea42b8 100644
--- a/net/tnftp/files/libnetbsd/mkstemp.c
+++ b/net/tnftp/files/libnetbsd/mkstemp.c
@@ -1,5 +1,5 @@
-/* NetBSD: mkstemp.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: gettemp.c,v 1.5 1999/09/20 04:39:30 lukem Exp */
+/* NetBSD: mkstemp.c,v 1.5 2005/06/01 11:48:49 lukem Exp */
+/* from NetBSD: gettemp.c,v 1.13 2003/12/05 00:57:36 uebayasi Exp */
/*
* Copyright (c) 1987, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -41,7 +37,7 @@ mkstemp(char *path)
{
char *start, *trv;
struct stat sbuf;
- u_int pid;
+ unsigned int pid;
int fd;
/* To guarantee multiple calls generate unique names even if
@@ -60,9 +56,9 @@ mkstemp(char *path)
xcnt = 0;
/* Use at least one from xtra. Use 2 if more than 6 X's. */
- if (*(trv-1) == 'X')
+ if (*(trv - 1) == 'X')
*--trv = xtra[0];
- if (xcnt > 6 && *(trv-1) == 'X')
+ if (xcnt > 6 && *(trv - 1) == 'X')
*--trv = xtra[1];
/* Set remaining X's to pid digits with 0's to the left. */
@@ -103,7 +99,7 @@ mkstemp(char *path)
}
for (;;) {
- if ((fd = open(path, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0)
+ if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR, 0600)) >= 0)
return (fd);
if (errno != EEXIST)
return (-1);
diff --git a/net/tnftp/files/libnetbsd/sl_init.c b/net/tnftp/files/libnetbsd/sl_init.c
index 71e86c428d4..f1b64ecffd2 100644
--- a/net/tnftp/files/libnetbsd/sl_init.c
+++ b/net/tnftp/files/libnetbsd/sl_init.c
@@ -1,5 +1,5 @@
-/* NetBSD: sl_init.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: stringlist.c,v 1.8 1999/11/28 03:44:09 lukem Exp */
+/* NetBSD: sl_init.c,v 1.4 2005/05/16 06:37:47 lukem Exp */
+/* from NetBSD: stringlist.c,v 1.10 2000/01/25 16:24:40 enami Exp */
/*-
* Copyright (c) 1994, 1999 The NetBSD Foundation, Inc.
@@ -73,10 +73,11 @@ sl_add(StringList *sl, char *name)
if (sl->sl_cur == sl->sl_max - 1) {
char **new;
- sl->sl_max += _SL_CHUNKSIZE;
- new = (char **)realloc(sl->sl_str, sl->sl_max * sizeof(char *));
+ new = (char **)realloc(sl->sl_str,
+ (sl->sl_max + _SL_CHUNKSIZE) * sizeof(char *));
if (new == NULL)
return (-1);
+ sl->sl_max += _SL_CHUNKSIZE;
sl->sl_str = new;
}
sl->sl_str[sl->sl_cur++] = name;
@@ -114,7 +115,7 @@ sl_find(StringList *sl, char *name)
for (i = 0; i < sl->sl_cur; i++)
if (strcmp(sl->sl_str[i], name) == 0)
- return sl->sl_str[i];
+ return (sl->sl_str[i]);
return (NULL);
}
diff --git a/net/tnftp/files/libnetbsd/strdup.c b/net/tnftp/files/libnetbsd/strdup.c
index e6c0c32a1a6..75a4005e263 100644
--- a/net/tnftp/files/libnetbsd/strdup.c
+++ b/net/tnftp/files/libnetbsd/strdup.c
@@ -1,5 +1,5 @@
-/* NetBSD: strdup.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: strdup.c,v 1.11 1999/09/20 04:3 9:46 lukem Exp */
+/* NetBSD: strdup.c,v 1.4 2005/05/16 06:40:04 lukem Exp */
+/* from NetBSD: strdup.c,v 1.13 2003/08/07 16:43:50 agc Exp */
/*
* Copyright (c) 1988, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/net/tnftp/files/libnetbsd/strlcat.c b/net/tnftp/files/libnetbsd/strlcat.c
index e50fa35adec..523a8b2506d 100644
--- a/net/tnftp/files/libnetbsd/strlcat.c
+++ b/net/tnftp/files/libnetbsd/strlcat.c
@@ -1,32 +1,21 @@
-/* NetBSD: strlcat.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: strlcat.c,v 1.5 1999/09/20 04:39:47 lukem Exp */
-/* from OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp */
+/* NetBSD: strlcat.c,v 1.4 2005/05/16 06:55:48 lukem Exp */
+/* from NetBSD: strlcat.c,v 1.16 2003/10/27 00:12:42 lukem Exp */
+/* from OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "tnftp.h"
@@ -34,8 +23,9 @@
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
+ * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
*/
size_t
strlcat(char *dst, const char *src, size_t siz)
@@ -46,7 +36,7 @@ strlcat(char *dst, const char *src, size_t siz)
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
- while (*d != '\0' && n-- != 0)
+ while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
diff --git a/net/tnftp/files/libnetbsd/strlcpy.c b/net/tnftp/files/libnetbsd/strlcpy.c
index 9446235b5e7..7f2d4d07438 100644
--- a/net/tnftp/files/libnetbsd/strlcpy.c
+++ b/net/tnftp/files/libnetbsd/strlcpy.c
@@ -1,32 +1,21 @@
-/* NetBSD: strlcpy.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: strlcpy.c,v 1.5 1999/09/20 04:39:47 lukem Exp */
-/* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */
+/* NetBSD: strlcpy.c,v 1.4 2005/05/16 06:58:06 lukem Exp */
+/* from NetBSD: strlcpy.c,v 1.14 2003/10/27 00:12:42 lukem Exp */
+/* from OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
- * 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. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
+ * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include "tnftp.h"
diff --git a/net/tnftp/files/libnetbsd/strsep.c b/net/tnftp/files/libnetbsd/strsep.c
index 565728be0ef..762915452be 100644
--- a/net/tnftp/files/libnetbsd/strsep.c
+++ b/net/tnftp/files/libnetbsd/strsep.c
@@ -1,5 +1,5 @@
-/* NetBSD: strsep.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: strsep.c,v 1.10 1999/09/20 04:39:48 lukem Exp */
+/* NetBSD: strsep.c,v 1.4 2005/05/16 08:51:51 lukem Exp */
+/* from NetBSD: strsep.c,v 1.14 2003/08/07 16:43:52 agc Exp */
/*-
* Copyright (c) 1990, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
diff --git a/net/tnftp/files/libnetbsd/strtoll.c b/net/tnftp/files/libnetbsd/strtoll.c
index a67fddd51ef..f2801d826fa 100644
--- a/net/tnftp/files/libnetbsd/strtoll.c
+++ b/net/tnftp/files/libnetbsd/strtoll.c
@@ -1,5 +1,5 @@
-/* NetBSD: strtoll.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: strtoq.c,v 1.14 1999/09/20 04:39:42 lukem Exp */
+/* NetBSD: strtoll.c,v 1.4 2005/05/16 11:27:58 lukem Exp */
+/* from NetBSD: strtoll.c,v 1.6 2003/10/27 00:12:42 lukem Exp */
/*-
* Copyright (c) 1992, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -37,16 +33,17 @@
#include "tnftp.h"
/*
- * Convert a string to a quad integer.
+ * Convert a string to a long long integer.
*
* Ignores `locale' stuff. Assumes that the upper and lower case
* alphabets and digits are each contiguous.
*/
-long long
+long long int
strtoll(const char *nptr, char **endptr, int base)
{
const char *s;
- long long acc, cutoff;
+ /* LONGLONG */
+ long long int acc, cutoff;
int c;
int neg, any, cutlim;
@@ -90,7 +87,7 @@ strtoll(const char *nptr, char **endptr, int base)
* followed by a legal input character, is too big. One that
* is equal to this value may be valid or not; the limit
* between valid and invalid numbers is then based on the last
- * digit. For instance, if the range for quads is
+ * digit. For instance, if the range for long longs is
* [-9223372036854775808..9223372036854775807] and the input base
* is 10, cutoff will be set to 922337203685477580 and cutlim to
* either 7 (neg==0) or 8 (neg==1), meaning that if we have
@@ -101,7 +98,7 @@ strtoll(const char *nptr, char **endptr, int base)
* Set any if any `digits' consumed; make it negative to indicate
* overflow.
*/
- cutoff = neg ? QUAD_MIN : QUAD_MAX;
+ cutoff = neg ? LLONG_MIN : LLONG_MAX;
cutlim = (int)(cutoff % base);
cutoff /= base;
if (neg) {
@@ -125,7 +122,7 @@ strtoll(const char *nptr, char **endptr, int base)
if (neg) {
if (acc < cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
- acc = QUAD_MIN;
+ acc = LLONG_MIN;
errno = ERANGE;
} else {
any = 1;
@@ -135,7 +132,7 @@ strtoll(const char *nptr, char **endptr, int base)
} else {
if (acc > cutoff || (acc == cutoff && c > cutlim)) {
any = -1;
- acc = QUAD_MAX;
+ acc = LLONG_MAX;
errno = ERANGE;
} else {
any = 1;
diff --git a/net/tnftp/files/libnetbsd/strunvis.c b/net/tnftp/files/libnetbsd/strunvis.c
index 35d1c78f895..562a5395dfd 100644
--- a/net/tnftp/files/libnetbsd/strunvis.c
+++ b/net/tnftp/files/libnetbsd/strunvis.c
@@ -1,5 +1,5 @@
-/* NetBSD: strunvis.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: unvis.c,v 1.16 1999/09/20 04:39:06 lukem Exp */
+/* NetBSD: strunvis.c,v 1.5 2005/06/01 11:48:49 lukem Exp */
+/* from NetBSD: unvis.c,v 1.27 2005/05/16 11:42:04 lukem Exp */
/*-
* Copyright (c) 1989, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -46,8 +42,11 @@
#define S_CTRL 4 /* control char started (^) */
#define S_OCTAL2 5 /* octal digit 2 */
#define S_OCTAL3 6 /* octal digit 3 */
+#define S_HEX1 7 /* hex digit */
+#define S_HEX2 8 /* hex digit 2 */
-#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
+#define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
+#define xtod(c) (isdigit(c) ? (c - '0') : ((tolower(c) - 'a') + 10))
/*
* unvis - decode characters previously encoded by vis
@@ -55,12 +54,14 @@
int
unvis(char *cp, int c, int *astate, int flag)
{
+ unsigned char uc = (unsigned char)c;
if (flag & UNVIS_END) {
- if (*astate == S_OCTAL2 || *astate == S_OCTAL3) {
+ if (*astate == S_OCTAL2 || *astate == S_OCTAL3
+ || *astate == S_HEX2) {
*astate = S_GROUND;
return (UNVIS_VALID);
- }
+ }
return (*astate == S_GROUND ? UNVIS_NOCHAR : UNVIS_SYNBAD);
}
@@ -71,7 +72,11 @@ unvis(char *cp, int c, int *astate, int flag)
if (c == '\\') {
*astate = S_START;
return (0);
- }
+ }
+ if ((flag & VIS_HTTPSTYLE) && c == '%') {
+ *astate = S_HEX1;
+ return (0);
+ }
*cp = c;
return (UNVIS_VALID);
@@ -144,7 +149,7 @@ unvis(char *cp, int c, int *astate, int flag)
}
*astate = S_GROUND;
return (UNVIS_SYNBAD);
-
+
case S_META:
if (c == '-')
*astate = S_META1;
@@ -155,12 +160,12 @@ unvis(char *cp, int c, int *astate, int flag)
return (UNVIS_SYNBAD);
}
return (0);
-
+
case S_META1:
*astate = S_GROUND;
*cp |= c;
return (UNVIS_VALID);
-
+
case S_CTRL:
if (c == '?')
*cp |= 0177;
@@ -170,23 +175,23 @@ unvis(char *cp, int c, int *astate, int flag)
return (UNVIS_VALID);
case S_OCTAL2: /* second possible octal digit */
- if (isoctal(c)) {
- /*
- * yes - and maybe a third
+ if (isoctal(uc)) {
+ /*
+ * yes - and maybe a third
*/
*cp = (*cp << 3) + (c - '0');
- *astate = S_OCTAL3;
+ *astate = S_OCTAL3;
return (0);
- }
- /*
- * no - done with current sequence, push back passed char
+ }
+ /*
+ * no - done with current sequence, push back passed char
*/
*astate = S_GROUND;
return (UNVIS_VALIDPUSH);
case S_OCTAL3: /* third possible octal digit */
*astate = S_GROUND;
- if (isoctal(c)) {
+ if (isoctal(uc)) {
*cp = (*cp << 3) + (c - '0');
return (UNVIS_VALID);
}
@@ -194,10 +199,30 @@ unvis(char *cp, int c, int *astate, int flag)
* we were done, push back passed char
*/
return (UNVIS_VALIDPUSH);
-
- default:
- /*
- * decoder in unknown state - (probably uninitialized)
+
+ case S_HEX1:
+ if (isxdigit(uc)) {
+ *cp = xtod(uc);
+ *astate = S_HEX2;
+ return (0);
+ }
+ /*
+ * no - done with current sequence, push back passed char
+ */
+ *astate = S_GROUND;
+ return (UNVIS_VALIDPUSH);
+
+ case S_HEX2:
+ *astate = S_GROUND;
+ if (isxdigit(uc)) {
+ *cp = xtod(uc) | (*cp << 4);
+ return (UNVIS_VALID);
+ }
+ return (UNVIS_VALIDPUSH);
+
+ default:
+ /*
+ * decoder in unknown state - (probably uninitialized)
*/
*astate = S_GROUND;
return (UNVIS_SYNBAD);
@@ -205,22 +230,22 @@ unvis(char *cp, int c, int *astate, int flag)
}
/*
- * strunvis - decode src into dst
+ * strunvis - decode src into dst
*
* Number of chars decoded into dst is returned, -1 on error.
* Dst is null terminated.
*/
int
-strunvis(char *dst, const char *src)
+strunvisx(char *dst, const char *src, int flag)
{
char c;
char *start = dst;
int state = 0;
while ((c = *src++) != '\0') {
- again:
- switch (unvis(dst, c, &state, 0)) {
+ again:
+ switch (unvis(dst, c, &state, flag)) {
case UNVIS_VALID:
dst++;
break;
@@ -239,3 +264,9 @@ strunvis(char *dst, const char *src)
*dst = '\0';
return (dst - start);
}
+
+int
+strunvis(char *dst, const char *src)
+{
+ return strunvisx(dst, src, 0);
+}
diff --git a/net/tnftp/files/libnetbsd/strvis.c b/net/tnftp/files/libnetbsd/strvis.c
index 7f369f86334..f98d4d2a96d 100644
--- a/net/tnftp/files/libnetbsd/strvis.c
+++ b/net/tnftp/files/libnetbsd/strvis.c
@@ -1,5 +1,5 @@
-/* NetBSD: strvis.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
-/* from NetBSD: vis.c,v 1.13 1999/09/20 04:39:07 lukem Exp */
+/* NetBSD: strvis.c,v 1.8 2005/06/01 11:48:49 lukem Exp */
+/* from NetBSD: vis.c,v 1.33 2005/05/28 13:11:14 lukem Exp */
/*-
* Copyright (c) 1989, 1993
@@ -13,11 +13,7 @@
* 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -34,107 +30,291 @@
* SUCH DAMAGE.
*/
+/*-
+ * Copyright (c) 1999, 2005 The NetBSD Foundation, Inc.
+ * 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. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
#include "tnftp.h"
-#define isoctal(c) (((u_char)(c)) >= '0' && ((u_char)(c)) <= '7')
+#undef BELL
+#define BELL '\a'
+
+#define isoctal(c) (((unsigned char)(c)) >= '0' && ((unsigned char)(c)) <= '7')
+#define iswhite(c) (c == ' ' || c == '\t' || c == '\n')
+#define issafe(c) (c == '\b' || c == BELL || c == '\r')
+#define xtoa(c) "0123456789abcdef"[c]
+
+#define MAXEXTRAS 5
+
+
+#define MAKEEXTRALIST(flag, extra, orig) \
+do { \
+ const char *o = orig; \
+ char *e; \
+ while (*o++) \
+ continue; \
+ extra = malloc((size_t)((o - orig) + MAXEXTRAS)); \
+ if (!extra) break; \
+ for (o = orig, e = extra; (*e++ = *o++) != '\0';) \
+ continue; \
+ e--; \
+ if (flag & VIS_SP) *e++ = ' '; \
+ if (flag & VIS_TAB) *e++ = '\t'; \
+ if (flag & VIS_NL) *e++ = '\n'; \
+ if ((flag & VIS_NOSLASH) == 0) *e++ = '\\'; \
+ *e = '\0'; \
+} while (/*CONSTCOND*/0)
+
/*
- * vis - visually encode characters
+ * This is HVIS, the macro of vis used to HTTP style (RFC 1808)
+ */
+#define HVIS(dst, c, flag, nextc, extra) \
+do \
+ if (!isascii(c) || !isalnum(c) || strchr("$-_.+!*'(),", c) != NULL) { \
+ *dst++ = '%'; \
+ *dst++ = xtoa(((unsigned int)c >> 4) & 0xf); \
+ *dst++ = xtoa((unsigned int)c & 0xf); \
+ } else { \
+ SVIS(dst, c, flag, nextc, extra); \
+ } \
+while (/*CONSTCOND*/0)
+
+/*
+ * This is SVIS, the central macro of vis.
+ * dst: Pointer to the destination buffer
+ * c: Character to encode
+ * flag: Flag word
+ * nextc: The character following 'c'
+ * extra: Pointer to the list of extra characters to be
+ * backslash-protected.
+ */
+#define SVIS(dst, c, flag, nextc, extra) \
+do { \
+ int isextra; \
+ isextra = strchr(extra, c) != NULL; \
+ if (!isextra && isascii(c) && (isgraph(c) || iswhite(c) || \
+ ((flag & VIS_SAFE) && issafe(c)))) { \
+ *dst++ = c; \
+ break; \
+ } \
+ if (flag & VIS_CSTYLE) { \
+ switch (c) { \
+ case '\n': \
+ *dst++ = '\\'; *dst++ = 'n'; \
+ continue; \
+ case '\r': \
+ *dst++ = '\\'; *dst++ = 'r'; \
+ continue; \
+ case '\b': \
+ *dst++ = '\\'; *dst++ = 'b'; \
+ continue; \
+ case BELL: \
+ *dst++ = '\\'; *dst++ = 'a'; \
+ continue; \
+ case '\v': \
+ *dst++ = '\\'; *dst++ = 'v'; \
+ continue; \
+ case '\t': \
+ *dst++ = '\\'; *dst++ = 't'; \
+ continue; \
+ case '\f': \
+ *dst++ = '\\'; *dst++ = 'f'; \
+ continue; \
+ case ' ': \
+ *dst++ = '\\'; *dst++ = 's'; \
+ continue; \
+ case '\0': \
+ *dst++ = '\\'; *dst++ = '0'; \
+ if (isoctal(nextc)) { \
+ *dst++ = '0'; \
+ *dst++ = '0'; \
+ } \
+ continue; \
+ default: \
+ if (isgraph(c)) { \
+ *dst++ = '\\'; *dst++ = c; \
+ continue; \
+ } \
+ } \
+ } \
+ if (isextra || ((c & 0177) == ' ') || (flag & VIS_OCTAL)) { \
+ *dst++ = '\\'; \
+ *dst++ = (unsigned char)(((uint32_t)(unsigned char)c >> 6) & 03) + '0'; \
+ *dst++ = (unsigned char)(((uint32_t)(unsigned char)c >> 3) & 07) + '0'; \
+ *dst++ = (c & 07) + '0'; \
+ } else { \
+ if ((flag & VIS_NOSLASH) == 0) *dst++ = '\\'; \
+ if (c & 0200) { \
+ c &= 0177; *dst++ = 'M'; \
+ } \
+ if (iscntrl(c)) { \
+ *dst++ = '^'; \
+ if (c == 0177) \
+ *dst++ = '?'; \
+ else \
+ *dst++ = c + '@'; \
+ } else { \
+ *dst++ = '-'; *dst++ = c; \
+ } \
+ } \
+} while (/*CONSTCOND*/0)
+
+
+/*
+ * svis - visually encode characters, also encoding the characters
+ * pointed to by `extra'
*/
char *
-vis(char *dst, int c, int flag, int nextc)
+svis(char *dst, int c, int flag, int nextc, const char *extra)
{
+ char *nextra = NULL;
- if (((u_int)c <= UCHAR_MAX && isascii(c) && isgraph(c)) ||
- ((flag & VIS_SP) == 0 && c == ' ') ||
- ((flag & VIS_TAB) == 0 && c == '\t') ||
- ((flag & VIS_NL) == 0 && c == '\n') ||
- ((flag & VIS_SAFE) && (c == '\b' || c == '\007' || c == '\r'))) {
- *dst++ = c;
- if (c == '\\' && (flag & VIS_NOSLASH) == 0)
- *dst++ = '\\';
- *dst = '\0';
- return (dst);
+ MAKEEXTRALIST(flag, nextra, extra);
+ if (!nextra) {
+ *dst = '\0'; /* can't create nextra, return "" */
+ return dst;
}
+ if (flag & VIS_HTTPSTYLE)
+ HVIS(dst, c, flag, nextc, nextra);
+ else
+ SVIS(dst, c, flag, nextc, nextra);
+ free(nextra);
+ *dst = '\0';
+ return dst;
+}
- if (flag & VIS_CSTYLE) {
- switch(c) {
- case '\n':
- *dst++ = '\\';
- *dst++ = 'n';
- goto done;
- case '\r':
- *dst++ = '\\';
- *dst++ = 'r';
- goto done;
- case '\b':
- *dst++ = '\\';
- *dst++ = 'b';
- goto done;
- case '\a':
- *dst++ = '\\';
- *dst++ = 'a';
- goto done;
- case '\v':
- *dst++ = '\\';
- *dst++ = 'v';
- goto done;
- case '\t':
- *dst++ = '\\';
- *dst++ = 't';
- goto done;
- case '\f':
- *dst++ = '\\';
- *dst++ = 'f';
- goto done;
- case ' ':
- *dst++ = '\\';
- *dst++ = 's';
- goto done;
- case '\0':
- *dst++ = '\\';
- *dst++ = '0';
- if (isoctal(nextc)) {
- *dst++ = '0';
- *dst++ = '0';
- }
- goto done;
- }
+
+/*
+ * strsvis, strsvisx - visually encode characters from src into dst
+ *
+ * Extra is a pointer to a \0-terminated list of characters to
+ * be encoded, too. These functions are useful e. g. to
+ * encode strings in such a way so that they are not interpreted
+ * by a shell.
+ *
+ * Dst must be 4 times the size of src to account for possible
+ * expansion. The length of dst, not including the trailing NULL,
+ * is returned.
+ *
+ * Strsvisx encodes exactly len bytes from src into dst.
+ * This is useful for encoding a block of data.
+ */
+int
+strsvis(char *dst, const char *csrc, int flag, const char *extra)
+{
+ int c;
+ char *start;
+ char *nextra = NULL;
+ const unsigned char *src = (const unsigned char *)csrc;
+
+ MAKEEXTRALIST(flag, nextra, extra);
+ if (!nextra) {
+ *dst = '\0'; /* can't create nextra, return "" */
+ return 0;
}
- if (((c & 0177) == ' ') || (flag & VIS_OCTAL)) {
- *dst++ = '\\';
- *dst++ = ((((unsigned int)c) >> 6) & 07) + '0';
- *dst++ = ((((unsigned int)c) >> 3) & 07) + '0';
- *dst++ = (((u_char)c) & 07) + '0';
- goto done;
+ if (flag & VIS_HTTPSTYLE) {
+ for (start = dst; (c = *src++) != '\0'; /* empty */)
+ HVIS(dst, c, flag, *src, nextra);
+ } else {
+ for (start = dst; (c = *src++) != '\0'; /* empty */)
+ SVIS(dst, c, flag, *src, nextra);
}
- if ((flag & VIS_NOSLASH) == 0)
- *dst++ = '\\';
- if (c & 0200) {
- c &= 0177;
- *dst++ = 'M';
+ free(nextra);
+ *dst = '\0';
+ return (dst - start);
+}
+
+
+int
+strsvisx(char *dst, const char *csrc, size_t len, int flag, const char *extra)
+{
+ unsigned char c;
+ char *start;
+ char *nextra = NULL;
+ const unsigned char *src = (const unsigned char *)csrc;
+
+ MAKEEXTRALIST(flag, nextra, extra);
+ if (! nextra) {
+ *dst = '\0'; /* can't create nextra, return "" */
+ return 0;
}
- if (iscntrl(c)) {
- *dst++ = '^';
- if (c == 0177)
- *dst++ = '?';
- else
- *dst++ = c + '@';
+
+ if (flag & VIS_HTTPSTYLE) {
+ for (start = dst; len > 0; len--) {
+ c = *src++;
+ HVIS(dst, c, flag, len ? *src : '\0', nextra);
+ }
} else {
- *dst++ = '-';
- *dst++ = c;
+ for (start = dst; len > 0; len--) {
+ c = *src++;
+ SVIS(dst, c, flag, len ? *src : '\0', nextra);
+ }
}
-done:
+ free(nextra);
*dst = '\0';
- return (dst);
+ return (dst - start);
}
/*
+ * vis - visually encode characters
+ */
+char *
+vis(char *dst, int c, int flag, int nextc)
+{
+ char *extra = NULL;
+ unsigned char uc = (unsigned char)c;
+
+ MAKEEXTRALIST(flag, extra, "");
+ if (! extra) {
+ *dst = '\0'; /* can't create extra, return "" */
+ return dst;
+ }
+ if (flag & VIS_HTTPSTYLE)
+ HVIS(dst, uc, flag, nextc, extra);
+ else
+ SVIS(dst, uc, flag, nextc, extra);
+ free(extra);
+ *dst = '\0';
+ return dst;
+}
+
+
+/*
* strvis, strvisx - visually encode characters from src into dst
- *
+ *
* Dst must be 4 times the size of src to account for possible
* expansion. The length of dst, not including the trailing NULL,
- * is returned.
+ * is returned.
*
* Strvisx encodes exactly len bytes from src into dst.
* This is useful for encoding a block of data.
@@ -142,28 +322,32 @@ done:
int
strvis(char *dst, const char *src, int flag)
{
- char c;
- char *start;
+ char *extra = NULL;
+ int rv;
- for (start = dst; (c = *src) != '\0';)
- dst = vis(dst, c, flag, *++src);
- *dst = '\0';
- return (dst - start);
+ MAKEEXTRALIST(flag, extra, "");
+ if (!extra) {
+ *dst = '\0'; /* can't create extra, return "" */
+ return 0;
+ }
+ rv = strsvis(dst, src, flag, extra);
+ free(extra);
+ return rv;
}
+
int
strvisx(char *dst, const char *src, size_t len, int flag)
{
- char c;
- char *start;
+ char *extra = NULL;
+ int rv;
- for (start = dst; len > 1; len--) {
- c = *src;
- dst = vis(dst, c, flag, *++src);
+ MAKEEXTRALIST(flag, extra, "");
+ if (!extra) {
+ *dst = '\0'; /* can't create extra, return "" */
+ return 0;
}
- if (len)
- dst = vis(dst, *src, flag, '\0');
- *dst = '\0';
-
- return (dst - start);
+ rv = strsvisx(dst, src, len, flag, extra);
+ free(extra);
+ return rv;
}
diff --git a/net/tnftp/files/libnetbsd/usleep.c b/net/tnftp/files/libnetbsd/usleep.c
index 788d51694bb..f729e2d0506 100644
--- a/net/tnftp/files/libnetbsd/usleep.c
+++ b/net/tnftp/files/libnetbsd/usleep.c
@@ -1,7 +1,7 @@
-/* NetBSD: usleep.c,v 1.3 2005/05/11 01:01:56 lukem Exp */
+/* NetBSD: usleep.c,v 1.4 2005/05/16 13:21:43 lukem Exp */
/*-
- * Copyright (c) 1999-2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999,2000,2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -41,14 +41,14 @@
int
usleep(unsigned int usec)
{
-#if HAVE_SELECT
+#if HAVE_POLL
+ return (poll(NULL, 0, usec / 1000);
+#elif HAVE_SELECT
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = usec;
return (select(1, NULL, NULL, NULL, &tv));
-#elif HAVE_POLL
- return (poll(NULL, 0, usec / 1000);
#else
# error no way to implement usleep
#endif
diff --git a/net/tnftp/files/src/Makefile.in b/net/tnftp/files/src/Makefile.in
index 6d6d75df0b5..100dee8fcea 100644
--- a/net/tnftp/files/src/Makefile.in
+++ b/net/tnftp/files/src/Makefile.in
@@ -1,4 +1,4 @@
-# NetBSD: Makefile.in,v 1.3 2005/05/11 03:01:40 lukem Exp
+# NetBSD: Makefile.in,v 1.5 2005/06/10 04:36:12 lukem Exp
#
srcdir = @srcdir@
@@ -14,27 +14,35 @@ transform = @program_transform_name@
mandircat1 = ${mandir}/cat1
CC = @CC@
-CFLAGS = -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CFLAGS@
+CFLAGS = @CFLAGS@
+CPPFLAGS= -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CPPFLAGS@
LIBS = @LIBS@
LDFLAGS = @LDFLAGS@
INSTALL = @INSTALL@
PROG = ftp
-OBJS = cmds.o cmdtab.o complete.o domacro.o fetch.o ftp.o main.o \
- progressbar.o ruserpass.o util.o
+SRCS = cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
+ progressbar.c ruserpass.c util.c
+OBJS = ${SRCS:.c=.o}
+
all: ${PROG}
+${PROG}: ${OBJS} @LIBDEPENDS@
+ ${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
+
+${OBJS}: ${srcdir}/../tnftp.h ../config.h
+
+.c.o:
+ ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
+
install: all
-mkdir -p ${bindir}
${INSTALL} -m 555 ${PROG} ${bindir}/`echo ${PROG}|sed '$(transform)'`
-mkdir -p ${mandircat1}
${INSTALL} -m 444 ${srcdir}/${PROG}.cat1 ${mandircat1}/`echo ${PROG}|sed '$(transform)'`.1
-${PROG}: ${OBJS} @LIBDEPENDS@
- ${CC} ${CFLAGS} ${LDFLAGS} -o ${PROG} ${OBJS} ${LIBS}
-
clean:
rm -f core ${PROG} ${OBJS}
diff --git a/net/tnftp/files/src/cmds.c b/net/tnftp/files/src/cmds.c
index 96f931b8fde..d9a99d28149 100644
--- a/net/tnftp/files/src/cmds.c
+++ b/net/tnftp/files/src/cmds.c
@@ -1,5 +1,5 @@
-/* NetBSD: cmds.c,v 1.6 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: cmds.c,v 1.112 2005/04/11 01:49:31 lukem Exp */
+/* NetBSD: cmds.c,v 1.9 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: cmds.c,v 1.115 2005/06/10 00:18:46 lukem Exp */
/*-
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@@ -99,17 +99,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94";
-#else
-__RCSID("NetBSD: cmds.c,v 1.6 2005/05/11 02:41:28 lukem Exp");
-#endif
-#endif /* not lint */
-#endif
-
/*
* FTP User Program -- Command Routines.
*/
@@ -146,6 +135,7 @@ static const char *dotrans(char *, size_t, const char *);
static int
confirm(const char *cmd, const char *file)
{
+ const char *errormsg;
char line[BUFSIZ];
if (!interactive || confirmrest)
@@ -153,10 +143,9 @@ confirm(const char *cmd, const char *file)
while (1) {
fprintf(ttyout, "%s %s [anpqy?]? ", cmd, file);
(void)fflush(ttyout);
- if (fgets(line, sizeof(line), stdin) == NULL) {
+ if (getline(stdin, line, sizeof(line), &errormsg) < 0) {
mflag = 0;
- fprintf(ttyout, "\nEOF received; %s aborted\n", mname);
- clearerr(stdin);
+ fprintf(ttyout, "%s; %s aborted\n", errormsg, mname);
return (0);
}
switch (tolower((unsigned char)*line)) {
@@ -764,7 +753,7 @@ fget(int argc, char *argv[])
fclose(fp);
}
-char *
+const char *
onoff(int bool)
{
@@ -1319,7 +1308,7 @@ ls(int argc, char *argv[])
if (pagecmd) {
char *p;
- int len;
+ size_t len;
p = getoptionvalue("pager");
if (EMPTYSTRING(p))
@@ -1460,7 +1449,7 @@ shell(int argc, char *argv[])
void
user(int argc, char *argv[])
{
- char acct[80];
+ char *password;
int n, aflag = 0;
if (argc == 0)
@@ -1477,34 +1466,31 @@ user(int argc, char *argv[])
n = command("USER %s", argv[1]);
if (n == CONTINUE) {
if (argc < 3) {
- argv[2] = getpass("Password: ");
- argc++;
+ password = getpass("Password: ");
+ } else {
+ password = argv[2];
}
- n = command("PASS %s", argv[2]);
+ n = command("PASS %s", password);
+ memset(password, 0, strlen(password));
}
if (n == CONTINUE) {
+ aflag++;
if (argc < 4) {
- (void)fputs("Account: ", ttyout);
- (void)fflush(ttyout);
- if (fgets(acct, sizeof(acct) - 1, stdin) == NULL) {
- fprintf(ttyout,
- "\nEOF received; login aborted.\n");
- clearerr(stdin);
- code = -1;
- return;
- }
- acct[strlen(acct) - 1] = '\0';
- argv[3] = acct; argc++;
+ password = getpass("Account: ");
+ } else {
+ password = argv[3];
}
- n = command("ACCT %s", argv[3]);
- aflag++;
+ n = command("ACCT %s", password);
+ memset(password, 0, strlen(password));
}
if (n != COMPLETE) {
fputs("Login failed.\n", ttyout);
return;
}
if (!aflag && argc == 4) {
- (void)command("ACCT %s", argv[3]);
+ password = argv[3];
+ (void)command("ACCT %s", password);
+ memset(password, 0, strlen(password));
}
connected = -1;
getremoteinfo();
@@ -2513,7 +2499,7 @@ newer(int argc, char *argv[])
void
lpage(int argc, char *argv[])
{
- int len;
+ size_t len;
char *p, *pager, *locfile;
if (argc == 0 || argc > 2 ||
@@ -2546,7 +2532,8 @@ lpage(int argc, char *argv[])
void
page(int argc, char *argv[])
{
- int ohash, orestart_point, overbose, len;
+ int ohash, orestart_point, overbose;
+ size_t len;
char *p, *pager;
if (argc == 0 || argc > 2 ||
diff --git a/net/tnftp/files/src/cmdtab.c b/net/tnftp/files/src/cmdtab.c
index 9f52b0d012d..e065f5cb2b4 100644
--- a/net/tnftp/files/src/cmdtab.c
+++ b/net/tnftp/files/src/cmdtab.c
@@ -1,8 +1,8 @@
-/* NetBSD: cmdtab.c,v 1.5 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: cmdtab.c,v 1.44 2005/04/11 01:49:31 lukem Exp */
+/* NetBSD: cmdtab.c,v 1.7 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: cmdtab.c,v 1.45 2005/06/09 16:38:29 lukem Exp */
/*-
- * Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -66,17 +66,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94";
-#else
-__RCSID("NetBSD: cmdtab.c,v 1.5 2005/05/11 02:41:28 lukem Exp");
-#endif
-#endif /* not lint */
-#endif
-
#include "tnftp.h"
#include "ftp_var.h"
diff --git a/net/tnftp/files/src/complete.c b/net/tnftp/files/src/complete.c
index 60578967665..5dd7ed19b8d 100644
--- a/net/tnftp/files/src/complete.c
+++ b/net/tnftp/files/src/complete.c
@@ -1,8 +1,8 @@
-/* NetBSD: complete.c,v 1.3 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp */
+/* NetBSD: complete.c,v 1.6 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: complete.c,v 1.40 2005/06/09 16:38:29 lukem Exp */
/*-
- * Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2000,2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -37,13 +37,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("NetBSD: complete.c,v 1.3 2005/05/11 02:41:28 lukem Exp");
-#endif /* not lint */
-#endif
-
/*
* FTP user program - command and file completion routines
*/
@@ -64,7 +57,7 @@ static unsigned char complete_remote (char *, int);
static int
comparstr(const void *a, const void *b)
{
- return (strcmp(*(const char **)a, *(const char **)b));
+ return (strcmp(*(const char * const *)a, *(const char * const *)b));
}
/*
@@ -300,7 +293,7 @@ complete_remote(char *word, int list)
if (dirchange || dirlist == NULL ||
strcmp(dir, lastdir) != 0) { /* dir not cached */
- char *emesg;
+ const char *emesg;
if (dirlist != NULL)
sl_free(dirlist, 1);
diff --git a/net/tnftp/files/src/domacro.c b/net/tnftp/files/src/domacro.c
index 27c7657de89..001df2e2a91 100644
--- a/net/tnftp/files/src/domacro.c
+++ b/net/tnftp/files/src/domacro.c
@@ -1,4 +1,4 @@
-/* NetBSD: domacro.c,v 1.4 2005/05/11 02:41:28 lukem Exp */
+/* NetBSD: domacro.c,v 1.5 2005/06/09 16:47:50 lukem Exp */
/* from NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp */
/*
@@ -30,17 +30,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94";
-#else
-__RCSID("NetBSD: domacro.c,v 1.4 2005/05/11 02:41:28 lukem Exp");
-#endif
-#endif /* not lint */
-#endif
-
#include "tnftp.h"
#include "ftp_var.h"
diff --git a/net/tnftp/files/src/extern.h b/net/tnftp/files/src/extern.h
index 2998cd68fbe..ae12e760f3c 100644
--- a/net/tnftp/files/src/extern.h
+++ b/net/tnftp/files/src/extern.h
@@ -1,5 +1,5 @@
-/* NetBSD: extern.h,v 1.5 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: extern.h,v 1.66 2005/04/11 01:49:31 lukem Exp */
+/* NetBSD: extern.h,v 1.7 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: extern.h,v 1.69 2005/06/10 00:18:46 lukem Exp */
/*-
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@@ -142,6 +142,7 @@ int ftp_login(const char *, const char *, const char *);
void get(int, char **);
struct cmd *getcmd(const char *);
int getit(int, char **, int, const char *);
+int getline(FILE *, char *, size_t, const char **);
struct option *getoption(const char *);
char *getoptionvalue(const char *);
void getremoteinfo(void);
@@ -171,7 +172,7 @@ void mls(int, char **);
void mlst(int, char **);
void modtime(int, char **);
void mput(int, char **);
-char *onoff(int);
+const char *onoff(int);
void opts(int, char **);
void newer(int, char **);
void page(int, char **);
@@ -190,7 +191,7 @@ void quote1(const char *, int, char **);
void recvrequest(const char *, const char *, const char *,
const char *, int, int);
void reget(int, char **);
-char *remglob(char **, int, char **);
+char *remglob(char **, int, const char **);
time_t remotemodtime(const char *, int);
off_t remotesize(const char *, int);
void removedir(int, char **);
@@ -200,8 +201,7 @@ void restart(int, char **);
void rmthelp(int, char **);
void rmtstatus(int, char **);
char *rprompt(void);
-int ruserpass(const char *, const char **, const char **,
- const char **);
+int ruserpass(const char *, char **, char **, char **);
void sendrequest(const char *, const char *, const char *, int);
void setascii(int, char **);
void setbell(int, char **);
@@ -249,7 +249,7 @@ void updatelocalcwd(void);
void updateremotecwd(void);
void usage(void);
void user(int, char **);
-int xconnect(int, const struct sockaddr *, int);
+int xconnect(int, const struct sockaddr *, socklen_t);
int xlisten(int, int);
int xpoll(struct pollfd *, int, int);
void *xmalloc(size_t);
diff --git a/net/tnftp/files/src/fetch.c b/net/tnftp/files/src/fetch.c
index b835808ca76..2a8f1fdff3e 100644
--- a/net/tnftp/files/src/fetch.c
+++ b/net/tnftp/files/src/fetch.c
@@ -1,8 +1,8 @@
-/* NetBSD: fetch.c,v 1.7 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: fetch.c,v 1.157 2005/04/11 01:49:31 lukem Exp */
+/* NetBSD: fetch.c,v 1.11 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: fetch.c,v 1.162 2005/06/10 00:18:46 lukem Exp */
/*-
- * Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -40,13 +40,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("NetBSD: fetch.c,v 1.7 2005/05/11 02:41:28 lukem Exp");
-#endif /* not lint */
-#endif
-
/*
* FTP User Program -- Command line file retrieval
*/
@@ -129,7 +122,7 @@ static int
auth_url(const char *challenge, char **response, const char *guser,
const char *gpass)
{
- const char *cp, *scheme;
+ const char *cp, *scheme, *errormsg;
char *ep, *clear, *realm;
char user[BUFSIZ], *pass;
int rval;
@@ -176,8 +169,8 @@ auth_url(const char *challenge, char **response, const char *guser,
fprintf(ttyout, "%s\n", user);
} else {
(void)fflush(ttyout);
- if (fgets(user, sizeof(user) - 1, stdin) == NULL) {
- clearerr(stdin);
+ if (getline(stdin, user, sizeof(user), &errormsg) < 0) {
+ warnx("%s; can't authenticate", errormsg);
goto cleanup_auth_url;
}
user[strlen(user) - 1] = '\0';
@@ -201,7 +194,8 @@ auth_url(const char *challenge, char **response, const char *guser,
(void)strlcpy(*response, scheme, rlen);
len = strlcat(*response, " ", rlen);
/* use `clen - 1' to not encode the trailing NUL */
- base64_encode(clear, clen - 1, (unsigned char *)*response + len);
+ base64_encode((unsigned char *)clear, clen - 1,
+ (unsigned char *)*response + len);
memset(clear, 0, clen);
rval = 0;
@@ -332,6 +326,8 @@ parse_url(const char *url, const char *desc, url_t *type,
warnx("Invalid %s `%s'", desc, url);
cleanup_parse_url:
FREEPTR(*user);
+ if (*pass != NULL)
+ memset(*pass, 0, strlen(*pass));
FREEPTR(*pass);
FREEPTR(*host);
FREEPTR(*port);
@@ -677,7 +673,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
hints.ai_protocol = 0;
error = getaddrinfo(host, NULL, &hints, &res0);
if (error) {
- warnx("%s", gai_strerror(error));
+ warnx("%s: %s", host, gai_strerror(error));
goto cleanup_fetch_url;
}
if (res0->ai_canonname)
@@ -693,8 +689,9 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0)
strlcpy(hbuf, "invalid", sizeof(hbuf));
- if (verbose && res != res0)
+ if (verbose && res0->ai_next) {
fprintf(ttyout, "Trying %s...\n", hbuf);
+ }
((struct sockaddr_in *)res->ai_addr)->sin_port =
htons(portnum);
@@ -1037,9 +1034,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
fprintf(ttyout,
"Authorization failed. Retry (y/n)? ");
- if (fgets(reply, sizeof(reply), stdin)
- == NULL) {
- clearerr(stdin);
+ if (getline(stdin, reply, sizeof(reply), NULL)
+ < 0) {
goto cleanup_fetch_url;
}
if (tolower((unsigned char)reply[0]) != 'y')
@@ -1261,12 +1257,16 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
freeaddrinfo(res0);
FREEPTR(savefile);
FREEPTR(user);
+ if (pass != NULL)
+ memset(pass, 0, strlen(pass));
FREEPTR(pass);
FREEPTR(host);
FREEPTR(port);
FREEPTR(path);
FREEPTR(decodedpath);
FREEPTR(puser);
+ if (ppass != NULL)
+ memset(ppass, 0, strlen(ppass));
FREEPTR(ppass);
FREEPTR(buf);
FREEPTR(auth);
@@ -1282,7 +1282,7 @@ void
aborthttp(int notused)
{
char msgbuf[100];
- int len;
+ size_t len;
sigint_raised = 1;
alarmtimer(0);
@@ -1302,7 +1302,8 @@ fetch_ftp(const char *url)
char *cp, *xargv[5], rempath[MAXPATHLEN];
char *host, *path, *dir, *file, *user, *pass;
char *port;
- int dirhasglob, filehasglob, oautologin, rval, type, xargc;
+ int dirhasglob, filehasglob, rval, type, xargc;
+ int oanonftp, oautologin;
in_port_t portnum;
url_t urltype;
@@ -1420,8 +1421,10 @@ fetch_ftp(const char *url)
}
/* Set up the connection */
+ oanonftp = anonftp;
if (connected)
disconnect(0, NULL);
+ anonftp = oanonftp;
xargv[0] = (char *)getprogname(); /* XXX discards const */
xargv[1] = host;
xargv[2] = NULL;
@@ -1610,6 +1613,8 @@ fetch_ftp(const char *url)
FREEPTR(host);
FREEPTR(path);
FREEPTR(user);
+ if (pass)
+ memset(pass, 0, strlen(pass));
FREEPTR(pass);
return (rval);
}
@@ -1700,10 +1705,9 @@ go_fetch(const char *url)
int
auto_fetch(int argc, char *argv[])
{
- volatile int argpos;
- int rval;
+ volatile int argpos, rval;
- argpos = 0;
+ argpos = rval = 0;
if (sigsetjmp(toplevel, 1)) {
if (connected)
@@ -1718,7 +1722,7 @@ auto_fetch(int argc, char *argv[])
/*
* Loop through as long as there's files to fetch.
*/
- for (rval = 0; (rval == 0) && (argpos < argc); argpos++) {
+ for (; (rval == 0) && (argpos < argc); argpos++) {
if (strchr(argv[argpos], ':') == NULL)
break;
redirect_loop = 0;
@@ -1742,7 +1746,8 @@ int
auto_put(int argc, char **argv, const char *uploadserver)
{
char *uargv[4], *path, *pathsep;
- int uargc, rval, len;
+ int uargc, rval;
+ size_t len;
uargc = 0;
uargv[uargc++] = "mput";
@@ -1761,8 +1766,6 @@ auto_put(int argc, char **argv, const char *uploadserver)
* make sure we always pass a directory to auto_fetch
*/
if (argc > 1) { /* more than one file to upload */
- int len;
-
len = strlen(uploadserver) + 2; /* path + "/" + "\0" */
free(path);
path = (char *)xmalloc(len);
diff --git a/net/tnftp/files/src/ftp.c b/net/tnftp/files/src/ftp.c
index 4771d8e64a2..770685370a7 100644
--- a/net/tnftp/files/src/ftp.c
+++ b/net/tnftp/files/src/ftp.c
@@ -1,5 +1,5 @@
-/* NetBSD: ftp.c,v 1.7 2005/05/14 03:53:28 lukem Exp */
-/* from NetBSD: ftp.c,v 1.131 2005/05/13 05:03:49 lukem Exp */
+/* NetBSD: ftp.c,v 1.11 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: ftp.c,v 1.134 2005/06/10 00:18:46 lukem Exp */
/*-
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
@@ -97,17 +97,6 @@
#include "tnftp.h"
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
-#else
-__RCSID("NetBSD: ftp.c,v 1.7 2005/05/14 03:53:28 lukem Exp");
-#endif
-#endif /* not lint */
-#endif
-
#include <arpa/telnet.h>
#include "ftp_var.h"
@@ -147,11 +136,12 @@ struct sockinet myctladdr, hisctladdr, data_addr;
char *
hookup(char *host, char *port)
{
- int s = -1, len, error, portnum;
+ int s = -1, error, portnum;
struct addrinfo hints, *res, *res0;
char hbuf[MAXHOSTNAMELEN];
static char hostnamebuf[MAXHOSTNAMELEN];
char *cause = "unknown";
+ socklen_t len;
int on = 1;
memset((char *)&hisctladdr, 0, sizeof (hisctladdr));
@@ -164,7 +154,7 @@ hookup(char *host, char *port)
hints.ai_protocol = 0;
error = getaddrinfo(host, NULL, &hints, &res0);
if (error) {
- warnx("%s", gai_strerror(error));
+ warnx("%s: %s", host, gai_strerror(error));
code = -1;
return (0);
}
@@ -196,12 +186,8 @@ hookup(char *host, char *port)
* we use it as native. What a mess!
*/
ai_unmapped(res);
-#if 0 /*old behavior*/
- if (res != res0) /* not on the first address */
-#else
- if (res0->ai_next) /* if we have multiple possibilities */
-#endif
- {
+ if (verbose && res0->ai_next) {
+ /* if we have multiple possibilities */
if (getnameinfo(res->ai_addr, res->ai_addrlen,
hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST))
strlcpy(hbuf, "?", sizeof(hbuf));
@@ -244,7 +230,7 @@ hookup(char *host, char *port)
res0 = res = NULL;
len = hisctladdr.su_len;
- if (getsockname(s, (struct sockaddr *)&myctladdr.si_su, &len) < 0) {
+ if (getsockname(s, (struct sockaddr *)&myctladdr.si_su, &len) == -1) {
warn("getsockname");
code = -1;
goto bad;
@@ -553,7 +539,7 @@ void
abortxfer(int notused)
{
char msgbuf[100];
- int len;
+ size_t len;
sigint_raised = 1;
alarmtimer(0);
@@ -1253,11 +1239,12 @@ int
initconn(void)
{
char *p, *a;
- int result, len, tmpno = 0;
+ int result, tmpno = 0;
int on = 1;
int error;
- u_int addr[16], port[2];
- u_int af, hal, pal;
+ unsigned int addr[16], port[2];
+ unsigned int af, hal, pal;
+ socklen_t len;
char *pasvcmd = NULL;
#ifdef INET6
@@ -1557,7 +1544,7 @@ initconn(void)
}
len = sizeof(data_addr.si_su);
memset((char *)&data_addr, 0, sizeof (data_addr));
- if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) < 0) {
+ if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) == -1) {
warn("getsockname");
goto bad;
}
@@ -1672,9 +1659,10 @@ FILE *
dataconn(const char *lmode)
{
struct sockinet from;
- int s, fromlen, flags, rv, timeout;
+ int s, flags, rv, timeout;
struct timeval endtime, now, td;
struct pollfd pfd[1];
+ socklen_t fromlen;
if (passivemode) /* passive data connection */
return (fdopen(data, lmode));
@@ -2064,7 +2052,7 @@ void
abort_squared(int dummy)
{
char msgbuf[100];
- int len;
+ size_t len;
sigint_raised = 1;
alarmtimer(0);
@@ -2123,7 +2111,7 @@ ai_unmapped(struct addrinfo *ai)
#ifdef INET6
struct sockaddr_in6 *sin6;
struct sockaddr_in sin;
- int len;
+ socklen_t len;
if (ai->ai_family != AF_INET6)
return;
diff --git a/net/tnftp/files/src/main.c b/net/tnftp/files/src/main.c
index b92bbc6667c..67462769552 100644
--- a/net/tnftp/files/src/main.c
+++ b/net/tnftp/files/src/main.c
@@ -1,8 +1,8 @@
-/* NetBSD: main.c,v 1.8 2005/05/14 03:53:28 lukem Exp */
-/* from NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp */
+/* NetBSD: main.c,v 1.11 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: main.c,v 1.97 2005/06/10 00:18:46 lukem Exp */
/*-
- * Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -95,22 +95,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\
- The Regents of the University of California. All rights reserved.\n");
-#endif /* not lint */
-
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
-#else
-__RCSID("NetBSD: main.c,v 1.8 2005/05/14 03:53:28 lukem Exp");
-#endif
-#endif /* not lint */
-#endif
-
/*
* FTP User Program -- Command Interface.
*/
@@ -134,7 +118,8 @@ main(int argc, char *argv[])
int ch, rval;
struct passwd *pw;
char *cp, *ep, *anonuser, *anonpass, *upload_path;
- int dumbterm, s, len, isupload;
+ int dumbterm, s, isupload;
+ size_t len;
socklen_t slen;
#if 0 /* XXX */
@@ -623,7 +608,8 @@ cmdscanner(void)
{
struct cmd *c;
char *p;
- int num;
+ int ch;
+ size_t num;
for (;;) {
#ifndef NO_EDITCOMPLETE
@@ -636,32 +622,31 @@ cmdscanner(void)
fprintf(ttyout, "%s ", p);
(void)fflush(ttyout);
}
- if (fgets(line, sizeof(line), stdin) == NULL) {
+ num = getline(stdin, line, sizeof(line), NULL);
+ switch (num) {
+ case -1: /* EOF */
+ case -2: /* error */
if (fromatty)
putc('\n', ttyout);
quit(0, NULL);
- }
- num = strlen(line);
- if (num == 0)
- break;
- if (line[--num] == '\n') {
- if (num == 0)
- break;
- line[num] = '\0';
- } else if (num == sizeof(line) - 2) {
+ /* NOTREACHED */
+ case -3: /* too long; try again */
fputs("Sorry, input line is too long.\n",
ttyout);
- while ((num = getchar()) != '\n' && num != EOF)
- /* void */;
+ continue;
+ case 0: /* empty; try again */
+ continue;
+ default: /* all ok */
break;
- } /* else it was a line without a newline */
+ }
#ifndef NO_EDITCOMPLETE
} else {
const char *buf;
HistEvent ev;
cursor_pos = NULL;
- buf = el_gets(el, &num);
+ buf = el_gets(el, &ch);
+ num = ch;
if (buf == NULL || num == 0) {
if (fromatty)
putc('\n', ttyout);
diff --git a/net/tnftp/files/src/progressbar.c b/net/tnftp/files/src/progressbar.c
index 5d9d9f9d0d9..374efea4c5d 100644
--- a/net/tnftp/files/src/progressbar.c
+++ b/net/tnftp/files/src/progressbar.c
@@ -1,9 +1,9 @@
-/* pkgsrc $NetBSD $/
-/* NetBSD: progressbar.c,v 1.6 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp */
+/* pkgsrc $NetBSD: progressbar.c,v 1.5 2005/06/10 05:06:26 lukem Exp $ */
+/* NetBSD: progressbar.c,v 1.9 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: progressbar.c,v 1.10 2005/06/09 16:38:29 lukem Exp */
/*-
- * Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
+ * Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -38,13 +38,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("NetBSD: progressbar.c,v 1.6 2005/05/11 02:41:28 lukem Exp");
-#endif /* not lint */
-#endif
-
/*
* FTP User Program -- Misc support routines
*/
@@ -119,7 +112,8 @@ progressmeter(int flag)
struct timeval td;
off_t abbrevsize, bytespersec;
double elapsed;
- int ratio, barlength, i, remaining;
+ int ratio, i, remaining;
+ size_t barlength;
/*
* Work variables for progress bar.
@@ -130,7 +124,7 @@ progressmeter(int flag)
* these appropriately.
*/
#endif
- int len;
+ size_t len;
char buf[256]; /* workspace for progress bar */
#ifndef NO_PROGRESS
#define BAROVERHEAD 43 /* non `*' portion of progress bar */
@@ -217,7 +211,7 @@ progressmeter(int flag)
if (barlength > 0) {
i = barlength * ratio / 100;
len += snprintf(buf + len, BUFLEFT,
- "|%.*s%*s|", i, stars, barlength - i, "");
+ "|%.*s%*s|", i, stars, (int)(barlength - i), "");
}
}
@@ -294,7 +288,8 @@ ptransfer(int siginfo)
struct timeval now, td, wait;
double elapsed;
off_t bytespersec;
- int remaining, hh, i, len;
+ int remaining, hh, i;
+ size_t len;
char buf[256]; /* Work variable for transfer status. */
diff --git a/net/tnftp/files/src/ruserpass.c b/net/tnftp/files/src/ruserpass.c
index 616869837fd..491eb9565f9 100644
--- a/net/tnftp/files/src/ruserpass.c
+++ b/net/tnftp/files/src/ruserpass.c
@@ -1,5 +1,5 @@
-/* NetBSD: ruserpass.c,v 1.4 2005/05/11 02:41:28 lukem Exp */
-/* from NetBSD: ruserpass.c,v 1.29 2003/08/07 11:13:57 agc Exp */
+/* NetBSD: ruserpass.c,v 1.6 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: ruserpass.c,v 1.30 2005/06/10 00:18:47 lukem Exp */
/*
* Copyright (c) 1985, 1993, 1994
@@ -30,17 +30,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)ruserpass.c 8.4 (Berkeley) 4/27/95";
-#else
-__RCSID("NetBSD: ruserpass.c,v 1.4 2005/05/11 02:41:28 lukem Exp");
-#endif
-#endif /* not lint */
-#endif
-
#include "tnftp.h"
#include "ftp_var.h"
@@ -59,7 +48,7 @@ static FILE *cfile;
static char tokval[100];
static struct toktab {
- char *tokstr;
+ const char *tokstr;
int tval;
} toktab[] = {
{ "default", DEFAULT },
@@ -73,11 +62,11 @@ static struct toktab {
};
int
-ruserpass(const char *host, const char **aname, const char **apass,
- const char **aacct)
+ruserpass(const char *host, char **aname, char **apass, char **aacct)
{
char *tmp;
- char myname[MAXHOSTNAMELEN + 1], *mydomain;
+ const char *mydomain;
+ char myname[MAXHOSTNAMELEN + 1];
int t, i, c, usedefault = 0;
struct stat stb;
diff --git a/net/tnftp/files/src/util.c b/net/tnftp/files/src/util.c
index 17fdef68f48..6862fd4f316 100644
--- a/net/tnftp/files/src/util.c
+++ b/net/tnftp/files/src/util.c
@@ -1,5 +1,5 @@
-/* NetBSD: util.c,v 1.10 2005/05/14 03:53:28 lukem Exp */
-/* from NetBSD: util.c,v 1.122 2005/05/13 05:03:49 lukem Exp */
+/* NetBSD: util.c,v 1.14 2005/06/10 04:05:01 lukem Exp */
+/* from NetBSD: util.c,v 1.129 2005/06/10 00:18:47 lukem Exp */
/*-
* Copyright (c) 1997-2005 The NetBSD Foundation, Inc.
@@ -70,13 +70,6 @@
* SUCH DAMAGE.
*/
-#if 0
-#include <sys/cdefs.h>
-#ifndef lint
-__RCSID("NetBSD: util.c,v 1.10 2005/05/14 03:53:28 lukem Exp");
-#endif /* not lint */
-#endif
-
/*
* FTP User Program -- Misc support routines
*/
@@ -355,34 +348,35 @@ lostpeer(int dummy)
* Return non-zero if successful.
*/
int
-ftp_login(const char *host, const char *user, const char *pass)
+ftp_login(const char *host, const char *luser, const char *lpass)
{
char tmp[80];
- const char *acct;
- int n, aflag, rval, freeuser, freepass, freeacct;
+ char *user, *pass, *acct, *p;
+ const char *errormsg;
+ int n, aflag, rval, nlen;
- acct = NULL;
- aflag = rval = freeuser = freepass = freeacct = 0;
+ aflag = rval = 0;
+ user = pass = acct = NULL;
+ if (luser)
+ user = xstrdup(luser);
+ if (lpass)
+ pass = xstrdup(lpass);
if (debug)
fprintf(ttyout, "ftp_login: user `%s' pass `%s' host `%s'\n",
user ? user : "<null>", pass ? pass : "<null>",
host ? host : "<null>");
-
/*
* Set up arguments for an anonymous FTP session, if necessary.
*/
if (anonftp) {
- user = "anonymous"; /* as per RFC 1635 */
- pass = getoptionvalue("anonpass");
+ FREEPTR(user);
+ user = xstrdup("anonymous"); /* as per RFC 1635 */
+ FREEPTR(pass);
+ pass = xstrdup(getoptionvalue("anonpass"));
}
- if (user == NULL)
- freeuser = 1;
- if (pass == NULL)
- freepass = 1;
- freeacct = 1;
if (ruserpass(host, &user, &pass, &acct) < 0) {
code = -1;
goto cleanup_ftp_login;
@@ -393,53 +387,55 @@ ftp_login(const char *host, const char *user, const char *pass)
fprintf(ttyout, "Name (%s:%s): ", host, localname);
else
fprintf(ttyout, "Name (%s): ", host);
- *tmp = '\0';
- if (fgets(tmp, sizeof(tmp) - 1, stdin) == NULL) {
- fprintf(ttyout, "\nEOF received; login aborted.\n");
- clearerr(stdin);
+ errormsg = NULL;
+ nlen = getline(stdin, tmp, sizeof(tmp), &errormsg);
+ if (nlen < 0) {
+ fprintf(ttyout, "%s; %s aborted.\n", errormsg, "login");
code = -1;
goto cleanup_ftp_login;
+ } else if (nlen == 0) {
+ user = xstrdup(localname);
+ } else {
+ user = xstrdup(tmp);
}
- tmp[strlen(tmp) - 1] = '\0';
- freeuser = 0;
- if (*tmp == '\0')
- user = localname;
- else
- user = tmp;
}
if (gatemode) {
char *nuser;
- int len;
+ size_t len;
len = strlen(user) + 1 + strlen(host) + 1;
nuser = xmalloc(len);
(void)strlcpy(nuser, user, len);
(void)strlcat(nuser, "@", len);
(void)strlcat(nuser, host, len);
- freeuser = 1;
+ FREEPTR(user);
user = nuser;
}
n = command("USER %s", user);
if (n == CONTINUE) {
if (pass == NULL) {
- freepass = 0;
- pass = getpass("Password:");
+ p = getpass("Password: ");
+ pass = xstrdup(p);
+ memset(p, 0, strlen(p));
}
n = command("PASS %s", pass);
+ memset(pass, 0, strlen(pass));
}
if (n == CONTINUE) {
aflag++;
if (acct == NULL) {
- freeacct = 0;
- acct = getpass("Account:");
+ p = getpass("Account: ");
+ acct = xstrdup(p);
+ memset(p, 0, strlen(p));
}
if (acct[0] == '\0') {
warnx("Login failed.");
goto cleanup_ftp_login;
}
n = command("ACCT %s", acct);
+ memset(acct, 0, strlen(acct));
}
if ((n != COMPLETE) ||
(!aflag && acct != NULL && command("ACCT %s", acct) != COMPLETE)) {
@@ -465,12 +461,13 @@ ftp_login(const char *host, const char *user, const char *pass)
updateremotecwd();
cleanup_ftp_login:
- if (user != NULL && freeuser)
- free((char *)user);
- if (pass != NULL && freepass)
- free((char *)pass);
- if (acct != NULL && freeacct)
- free((char *)acct);
+ FREEPTR(user);
+ if (pass != NULL)
+ memset(pass, 0, strlen(pass));
+ FREEPTR(pass);
+ if (acct != NULL)
+ memset(acct, 0, strlen(pass));
+ FREEPTR(acct);
return (rval);
}
@@ -483,21 +480,24 @@ ftp_login(const char *host, const char *user, const char *pass)
int
another(int *pargc, char ***pargv, const char *prompt)
{
- int len = strlen(line), ret;
+ const char *errormsg;
+ int ret, nlen;
+ size_t len;
+ len = strlen(line);
if (len >= sizeof(line) - 3) {
- fputs("sorry, arguments too long.\n", ttyout);
+ fputs("Sorry, arguments too long.\n", ttyout);
intr(0);
}
fprintf(ttyout, "(%s) ", prompt);
line[len++] = ' ';
- if (fgets(&line[len], sizeof(line) - len, stdin) == NULL) {
- clearerr(stdin);
+ errormsg = NULL;
+ nlen = getline(stdin, line + len, sizeof(line)-len, &errormsg);
+ if (nlen < 0) {
+ fprintf(ttyout, "%s; %s aborted.\n", errormsg, "operation");
intr(0);
}
- len += strlen(&line[len]);
- if (len > 0 && line[len - 1] == '\n')
- line[len - 1] = '\0';
+ len += nlen;
makeargv();
ret = margc > *pargc;
*pargc = margc;
@@ -511,65 +511,67 @@ another(int *pargc, char ***pargv, const char *prompt)
* of writing to the screen.
*/
char *
-remglob(char *argv[], int doswitch, char **errbuf)
+remglob(char *argv[], int doswitch, const char **errbuf)
{
- char temp[MAXPATHLEN];
- static char buf[MAXPATHLEN];
- static FILE *ftemp = NULL;
- static char **args;
- int oldverbose, oldhash, oldprogress, fd, len;
- char *cp, *mode;
-
- if (!mflag || !connected) {
- if (!doglob)
- args = NULL;
- else {
- if (ftemp) {
- (void)fclose(ftemp);
- ftemp = NULL;
- }
- }
- return (NULL);
- }
- if (!doglob) {
- if (args == NULL)
- args = argv;
- if ((cp = *++args) == NULL)
- args = NULL;
- return (cp);
- }
- if (ftemp == NULL) {
+ static char buf[MAXPATHLEN];
+ static FILE *ftemp = NULL;
+ static char **args;
+ char temp[MAXPATHLEN];
+ int oldverbose, oldhash, oldprogress, fd;
+ char *cp;
+ const char *mode;
+ size_t len;
+
+ if (!mflag || !connected) {
+ if (!doglob)
+ args = NULL;
+ else {
+ if (ftemp) {
+ (void)fclose(ftemp);
+ ftemp = NULL;
+ }
+ }
+ return (NULL);
+ }
+ if (!doglob) {
+ if (args == NULL)
+ args = argv;
+ if ((cp = *++args) == NULL)
+ args = NULL;
+ return (cp);
+ }
+ if (ftemp == NULL) {
len = strlcpy(temp, tmpdir, sizeof(temp));
if (temp[len - 1] != '/')
(void)strlcat(temp, "/", sizeof(temp));
(void)strlcat(temp, TMPFILE, sizeof(temp));
- if ((fd = mkstemp(temp)) < 0) {
- warn("unable to create temporary file %s", temp);
- return (NULL);
- }
- close(fd);
- oldverbose = verbose;
+ if ((fd = mkstemp(temp)) < 0) {
+ warn("unable to create temporary file %s", temp);
+ return (NULL);
+ }
+ close(fd);
+ oldverbose = verbose;
verbose = (errbuf != NULL) ? -1 : 0;
- oldhash = hash;
+ oldhash = hash;
oldprogress = progress;
- hash = 0;
+ hash = 0;
progress = 0;
- if (doswitch)
- pswitch(!proxy);
- for (mode = "w"; *++argv != NULL; mode = "a")
- recvrequest("NLST", temp, *argv, mode, 0, 0);
+ if (doswitch)
+ pswitch(!proxy);
+ for (mode = "w"; *++argv != NULL; mode = "a")
+ recvrequest("NLST", temp, *argv, mode, 0, 0);
if ((code / 100) != COMPLETE) {
if (errbuf != NULL)
*errbuf = reply_string;
}
- if (doswitch)
- pswitch(!proxy);
- verbose = oldverbose;
+ if (doswitch)
+ pswitch(!proxy);
+ verbose = oldverbose;
hash = oldhash;
progress = oldprogress;
- ftemp = fopen(temp, "r");
- (void)unlink(temp);
- if (ftemp == NULL) {
+ ftemp = fopen(temp, "r");
+ (void)unlink(temp);
+ if (ftemp == NULL) {
if (errbuf == NULL)
fputs(
"can't find list of remote files, oops.\n",
@@ -577,17 +579,17 @@ remglob(char *argv[], int doswitch, char **errbuf)
else
*errbuf =
"can't find list of remote files, oops.";
- return (NULL);
- }
- }
- if (fgets(buf, sizeof(buf), ftemp) == NULL) {
- (void)fclose(ftemp);
+ return (NULL);
+ }
+ }
+ if (fgets(buf, sizeof(buf), ftemp) == NULL) {
+ (void)fclose(ftemp);
ftemp = NULL;
- return (NULL);
- }
- if ((cp = strchr(buf, '\n')) != NULL)
- *cp = '\0';
- return (buf);
+ return (NULL);
+ }
+ if ((cp = strchr(buf, '\n')) != NULL)
+ *cp = '\0';
+ return (buf);
}
/*
@@ -815,20 +817,30 @@ updateremotecwd(void)
int
fileindir(const char *file, const char *dir)
{
- char realfile[PATH_MAX+1];
+ char parentdirbuf[PATH_MAX+1], *parentdir;
+ char realdir[PATH_MAX+1];
size_t dirlen;
- if (realpath(file, realfile) == NULL) {
- warn("Unable to determine real path of `%s'", file);
+ /* determine parent directory of file */
+ (void)strlcpy(parentdirbuf, file, sizeof(parentdirbuf));
+ parentdir = dirname(parentdirbuf);
+ if (strcmp(parentdir, ".") == 0)
+ return 1; /* current directory is ok */
+
+ /* find the directory */
+ if (realpath(parentdir, realdir) == NULL) {
+ warn("Unable to determine real path of `%s'", parentdir);
return 0;
}
- if (realfile[0] != '/') /* relative result */
+ if (realdir[0] != '/') /* relative result is ok */
return 1;
dirlen = strlen(dir);
#if 0
-printf("file %s realfile %s dir %s [%d]\n", file, realfile, dir, dirlen);
+printf("file %s parent %s realdir %s dir %s [%d]\n",
+ file, parentdir, realdir, dir, dirlen);
#endif
- if (strncmp(realfile, dir, dirlen) == 0 && realfile[dirlen] == '/')
+ if (strncmp(realdir, dir, dirlen) == 0 &&
+ (realdir[dirlen] == '/' || realdir[dirlen] == '\0'))
return 1;
return 0;
}
@@ -839,9 +851,10 @@ printf("file %s realfile %s dir %s [%d]\n", file, realfile, dir, dirlen);
void
list_vertical(StringList *sl)
{
- int i, j, w;
- int columns, width, lines;
+ int i, j;
+ int columns, lines;
char *p;
+ size_t w, width;
width = 0;
@@ -1055,8 +1068,7 @@ ftpvis(char *dst, size_t dstlen, const char *src, size_t srclen)
void
formatbuf(char *buf, size_t len, const char *src)
{
- const char *p;
- char *p2, *q;
+ const char *p, *p2, *q;
int i, op, updirs, pdirs;
#define ADDBUF(x) do { \
@@ -1135,7 +1147,7 @@ formatbuf(char *buf, size_t len, const char *src)
case 'M':
case 'm':
- for (p2 = connected && username ? username : "-";
+ for (p2 = connected && hostname ? hostname : "-";
*p2 ; p2++) {
if (op == 'm' && *p2 == '.')
break;
@@ -1223,6 +1235,56 @@ isipv6addr(const char *addr)
return (rv == 1) ? 1 : 0;
}
+/*
+ * Read a line from the FILE stream into buf/buflen using fgets(), so up
+ * to buflen-1 chars will be read and the result will be NUL terminated.
+ * If the line has a trailing newline it will be removed.
+ * If the line is too long, excess characters will be read until
+ * newline/EOF/error.
+ * If EOF/error occurs or a too-long line is encountered and errormsg
+ * isn't NULL, it will be changed to a description of the problem.
+ * (The EOF message has a leading \n for cosmetic purposes).
+ * Returns:
+ * >=0 length of line (excluding trailing newline) if all ok
+ * -1 error occurred
+ * -2 EOF encountered
+ * -3 line was too long
+ */
+int
+getline(FILE *stream, char *buf, size_t buflen, const char **errormsg)
+{
+ int rv, ch;
+ size_t len;
+
+ if (fgets(buf, buflen, stream) == NULL) {
+ if (feof(stream)) { /* EOF */
+ rv = -2;
+ if (errormsg)
+ *errormsg = "\nEOF received";
+ } else { /* error */
+ rv = -1;
+ if (errormsg)
+ *errormsg = "Error encountered";
+ }
+ clearerr(stream);
+ return rv;
+ }
+ len = strlen(buf);
+ if (buf[len-1] == '\n') { /* clear any trailing newline */
+ buf[--len] = '\0';
+ } else if (len == buflen-1) { /* line too long */
+ while ((ch = getchar()) != '\n' && ch != EOF)
+ continue;
+ if (errormsg)
+ *errormsg = "Input line is too long";
+ clearerr(stream);
+ return -3;
+ }
+ if (errormsg)
+ *errormsg = NULL;
+ return len;
+}
+
/*
* Internal version of connect(2); sets socket buffer sizes first and
@@ -1233,7 +1295,7 @@ isipv6addr(const char *addr)
* Returns -1 upon failure (with errno set to the problem), or 0 on success.
*/
int
-xconnect(int sock, const struct sockaddr *name, int namelen)
+xconnect(int sock, const struct sockaddr *name, socklen_t namelen)
{
int flags, rv, timeout, error;
socklen_t slen;
@@ -1327,12 +1389,16 @@ xpoll(struct pollfd *fds, int nfds, int timeout)
return poll(fds, nfds, timeout);
#elif HAVE_SELECT /* implement poll(2) using select(2) */
- fd_set rset, wset;
+ fd_set rset, wset, xset;
+ const int rsetflags = POLLIN | POLLRDNORM;
+ const int wsetflags = POLLOUT | POLLWRNORM;
+ const int xsetflags = POLLRDBAND;
struct timeval tv, *ptv;
int i, max, rv;
FD_ZERO(&rset); /* build list of read & write events */
FD_ZERO(&wset);
+ FD_ZERO(&xset);
max = 0;
for (i = 0; i < nfds; i++) {
if (fds[i].fd > FD_SETSIZE) {
@@ -1341,10 +1407,12 @@ xpoll(struct pollfd *fds, int nfds, int timeout)
return -1;
} else if (fds[i].fd > max)
max = fds[i].fd;
- if (fds[i].events & POLLIN)
+ if (fds[i].events & rsetflags)
FD_SET(fds[i].fd, &rset);
- if (fds[i].events & POLLOUT)
+ if (fds[i].events & wsetflags)
FD_SET(fds[i].fd, &wset);
+ if (fds[i].events & xsetflags)
+ FD_SET(fds[i].fd, &xset);
}
ptv = &tv; /* determine timeout */
@@ -1358,15 +1426,17 @@ xpoll(struct pollfd *fds, int nfds, int timeout)
ptv->tv_sec = timeout / 1000;
ptv->tv_usec = (timeout % 1000) * 1000;
}
- rv = select(max + 1, &rset, &wset, NULL, ptv);
+ rv = select(max + 1, &rset, &wset, &xset, ptv);
if (rv <= 0) /* -1 == error, 0 == timeout */
return rv;
for (i = 0; i < nfds; i++) { /* determine results */
if (FD_ISSET(fds[i].fd, &rset))
- fds[i].revents |= POLLIN;
+ fds[i].revents |= (fds[i].events & rsetflags);
if (FD_ISSET(fds[i].fd, &wset))
- fds[i].revents |= POLLOUT;
+ fds[i].revents |= (fds[i].events & wsetflags);
+ if (FD_ISSET(fds[i].fd, &xset))
+ fds[i].revents |= (fds[i].events & xsetflags);
}
return rv;
diff --git a/net/tnftp/files/src/version.h b/net/tnftp/files/src/version.h
index d87cda335aa..fe8af96f38e 100644
--- a/net/tnftp/files/src/version.h
+++ b/net/tnftp/files/src/version.h
@@ -1,4 +1,5 @@
-/* from NetBSD: version.h,v 1.49 2005/05/13 05:03:49 lukem Exp */
+/* NetBSD: version.h,v 1.1.1.10 2005/06/10 03:53:48 lukem Exp */
+/* from NetBSD: version.h,v 1.55 2005/06/10 00:18:47 lukem Exp */
/*-
* Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -40,5 +41,5 @@
#endif
#ifndef FTP_VERSION
-#define FTP_VERSION "20050513"
+#define FTP_VERSION "20050610"
#endif
diff --git a/net/tnftp/files/tnftp.h b/net/tnftp/files/tnftp.h
index 3a5089dc52e..e0afb921f95 100644
--- a/net/tnftp/files/tnftp.h
+++ b/net/tnftp/files/tnftp.h
@@ -1,7 +1,7 @@
-/* NetBSD: tnftp.h,v 1.13 2005/05/14 04:46:26 lukem Exp */
+/* NetBSD: tnftp.h,v 1.19 2005/06/10 04:40:13 lukem Exp */
#define FTP_PRODUCT "tnftp"
-#define FTP_VERSION "20050514"
+#define FTP_VERSION "20050610"
#include "config.h"
@@ -22,6 +22,7 @@
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <libgen.h>
#include <limits.h>
#ifdef HAVE_RFC2553_NETDB
#include <netdb.h>
@@ -55,10 +56,19 @@
# include <sys/poll.h>
#endif
#ifndef POLLIN
-# define POLLIN 1
+# define POLLIN 0x0001
#endif
#ifndef POLLOUT
-# define POLLOUT 4
+# define POLLOUT 0x0004
+#endif
+#ifndef POLLRDNORM
+# define POLLRDNORM 0x0040
+#endif
+#ifndef POLLWRNORM
+# define POLLWRNORM POLLOUT
+#endif
+#ifndef POLLRDBAND
+# define POLLRDBAND 0x0080
#endif
#ifndef INFTIM
# define INFTIM -1
@@ -253,20 +263,20 @@ typedef unsigned int socklen_t;
#if ! HAVE_RFC2553_NETDB && ! HAVE_ADDRINFO
struct addrinfo {
- int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
- int ai_family; /* PF_xxx */
- int ai_socktype; /* SOCK_xxx */
- int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
- size_t ai_addrlen; /* length of ai_addr */
- char *ai_canonname; /* canonical name for hostname */
+ int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+ int ai_family; /* PF_xxx */
+ int ai_socktype; /* SOCK_xxx */
+ int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+ socklen_t ai_addrlen; /* length of ai_addr */
+ char *ai_canonname; /* canonical name for hostname */
struct sockaddr *ai_addr; /* binary address */
struct addrinfo *ai_next; /* next structure in linked list */
};
int getaddrinfo(const char *, const char *,
const struct addrinfo *, struct addrinfo **);
-int getnameinfo(const struct sockaddr *, socklen_t, char *,
- size_t, char *, size_t, int);
+int getnameinfo(const struct sockaddr *, socklen_t,
+ char *, size_t, char *, size_t, int);
void freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
@@ -302,6 +312,10 @@ extern int optind;
int pclose(FILE *);
#endif
+#if ! HAVE_DIRNAME
+char *dirname(char *);
+#endif
+
#if ! HAVE_ERR
void err(int, const char *, ...);
void errx(int, const char *, ...);
@@ -327,7 +341,7 @@ char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
#endif
#if ! HAVE_INET_NTOP
-const char *inet_ntop(int, const void *, char *, size_t);
+const char *inet_ntop(int, const void *, char *, socklen_t);
#endif
#if ! HAVE_INET_PTON
@@ -362,11 +376,11 @@ char *strptime(const char *, const char *, struct tm *);
#if HAVE_QUAD_SUPPORT
# if ! HAVE_STRTOLL && HAVE_LONG_LONG
long long strtoll(const char *, char **, int);
-# if ! defined(QUAD_MIN)
-# define QUAD_MIN (-0x7fffffffffffffffL-1)
+# if ! defined(LLONG_MIN)
+# define LLONG_MIN (-0x7fffffffffffffffL-1)
# endif
-# if ! defined(QUAD_MAX)
-# define QUAD_MAX (0x7fffffffffffffffL)
+# if ! defined(LLONG_MAX)
+# define LLONG_MAX (0x7fffffffffffffffL)
# endif
# endif
#else /* ! HAVE_QUAD_SUPPORT */