MFC
This commit is contained in:
commit
49ea5c076c
@ -1,64 +0,0 @@
|
||||
diff -ru src.orig/cmds.c src/cmds.c
|
||||
--- src.orig/cmds.c Sun Jun 15 22:11:43 2003
|
||||
+++ src/cmds.c Sun Jun 15 21:46:37 2003
|
||||
@@ -131,6 +131,7 @@
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
+#include <libutil.h>
|
||||
|
||||
#include "ftp_var.h"
|
||||
#include "version.h"
|
||||
diff -ru src.orig/fetch.c src/fetch.c
|
||||
--- src.orig/fetch.c Sun Jun 15 22:11:43 2003
|
||||
+++ src/fetch.c Sun Jun 15 21:46:53 2003
|
||||
@@ -69,6 +69,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
+#include <libutil.h>
|
||||
|
||||
#include "ftp_var.h"
|
||||
#include "version.h"
|
||||
Only in src: ftp.cat1
|
||||
diff -ru src.orig/progressbar.c src/progressbar.c
|
||||
--- src.orig/progressbar.c Sun Jun 15 22:11:43 2003
|
||||
+++ src/progressbar.c Sun Jun 15 21:50:48 2003
|
||||
@@ -50,6 +50,7 @@
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
+#include <sys/time.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@@ -57,10 +58,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
-#include <tzfile.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "progressbar.h"
|
||||
+
|
||||
+#define SECSPERHOUR (60 * 60)
|
||||
+#define SECSPERDAY ((long)60 * 60 * 24)
|
||||
|
||||
#if !defined(NO_PROGRESS)
|
||||
/*
|
||||
diff -ru src.orig/util.c src/util.c
|
||||
--- src.orig/util.c Sun Jun 15 22:11:44 2003
|
||||
+++ src/util.c Sun Jun 15 21:51:31 2003
|
||||
@@ -101,10 +101,11 @@
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
#include <time.h>
|
||||
-#include <tzfile.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "ftp_var.h"
|
||||
+
|
||||
+#define TM_YEAR_BASE 1900
|
||||
|
||||
/*
|
||||
* Connect to peer server and auto-login, if possible.
|
@ -1,211 +0,0 @@
|
||||
INSTALLATION INTRODUCTION
|
||||
-------------------------
|
||||
|
||||
This file describes how to compile and install lukemftp on your
|
||||
system.
|
||||
|
||||
============================================
|
||||
= =
|
||||
= NOTE: You will need an ANSI C compiler. =
|
||||
= =
|
||||
============================================
|
||||
|
||||
|
||||
For most systems, execute the following to compile and install
|
||||
lukemftp:
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
A preformatted manual page (src/ftp.cat1) is also installed. If
|
||||
you wish to install the source (src/ftp.1), ensure that your system
|
||||
has up-to-date mandoc macros. groff ships with this macro suite,
|
||||
but it has bugs. Try:
|
||||
ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/tmac/
|
||||
for a more recent version.
|
||||
|
||||
|
||||
CONFIGURATION OPTIONS
|
||||
---------------------
|
||||
|
||||
lukemftp is configured using an `autoconf' generated `configure'
|
||||
script. `configure' supports the following options:
|
||||
|
||||
* The standard `autoconf configure' options, including:
|
||||
--prefix=PREFIX install architecture-independent files in PREFIX
|
||||
[/usr/local]
|
||||
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
||||
[same as prefix]
|
||||
--srcdir=DIR find the sources in DIR [configure dir or ..]
|
||||
BSD or GNU make may be required for this to work.
|
||||
|
||||
* Specific options:
|
||||
--enable-editcomplete Turn on command line editing and completion.
|
||||
--disable-editcomplete Turn off command line editing and completion
|
||||
[default: enabled].
|
||||
--enable-ipv6 Enable IPv6 support (if your OS supports it)
|
||||
--disable-ipv6 Disable IPv6 support (even if your OS supports it.)
|
||||
[default: enabled].
|
||||
--with-socks Compile with SOCKS firewall traversal support.
|
||||
--with-socks5[=PATH] Compile with SOCKS5 firewall traversal support.
|
||||
--with-socks4[=PATH] Compile with SOCKS4 firewall traversal support.
|
||||
|
||||
The following environment variables can be set to override various
|
||||
compiler related settings.
|
||||
CC=compiler specify name of the C compiler (default: gcc or cc)
|
||||
CFLAGS=flags specify flags to C compiler (default: -O -g or just -O)
|
||||
LDFLAGS=flags specify flags to linker (default: none)
|
||||
|
||||
This can be achieved with:
|
||||
env CC="compiler" CFLAGS="flags" LDFLAGS="flags" ./configure
|
||||
|
||||
|
||||
============================================
|
||||
= =
|
||||
= NOTE: You will need an ANSI C compiler. =
|
||||
= =
|
||||
============================================
|
||||
|
||||
|
||||
PLATFORM SPECIFIC NOTES
|
||||
-----------------------
|
||||
|
||||
The following platforms & compilers have been tested:
|
||||
|
||||
- AIX 4.1.5:
|
||||
- AIX 4.2.1:
|
||||
- AIX 4.3.3:
|
||||
- Compiler: xlc -qlanglvl=ansi
|
||||
version: xlC 3.1.4.10 -- C for AIX Compiler
|
||||
version: ibmcxx.cmp 3.6.6.6 -- IBM C and C++ Compilers
|
||||
|
||||
Configure with:
|
||||
env CC="xlc" CFLAGS="-qlanglvl=ansi" ./configure
|
||||
|
||||
- BSD/OS 4.0.1 (x86)
|
||||
- BSD/OS 4.1 (x86)
|
||||
- BSD/OS 4.1 (sparc)
|
||||
- BSD/OS 4.2 (x86)
|
||||
- Compiler: /bin/cc
|
||||
version: gcc 2.7.2.1
|
||||
version: gcc version 2.95.2 19991024
|
||||
|
||||
- Digital UNIX 4.0b
|
||||
- Digital UNIX 4.0d
|
||||
- Digital UNIX 4.0f
|
||||
- Compiler: cc -std
|
||||
version: DEC C V5.2-036 on Digital UNIX V4.0 (Rev. 564)
|
||||
version: DEC C V5.9-005 on Digital UNIX V4.0 (Rev. 1229)
|
||||
|
||||
Configure with
|
||||
env CC="cc -std" ./configure
|
||||
|
||||
- Compiler: gcc
|
||||
version: 2.95.1
|
||||
|
||||
- Digital UNIX 5.0
|
||||
- Compiler: cc
|
||||
version: Compaq C V6.1-011 on Digital UNIX V5.0 (Rev. 910)
|
||||
|
||||
- FreeBSD 3.4 (i386):
|
||||
- FreeBSD 3.5 (i386):
|
||||
- FreeBSD 4.1 (i386):
|
||||
- Compiler: cc
|
||||
version: gcc version 2.7.2.3
|
||||
version: gcc version 2.95.2 19991024
|
||||
|
||||
- HP/UX 10.20:
|
||||
- HP/UX 11.00:
|
||||
- Compiler: /opt/ansic/bin/cc -Ae
|
||||
version: A.10.32.03
|
||||
|
||||
Configure with
|
||||
env CC="cc -Ae" ./configure
|
||||
|
||||
To generate code that will run on old architectures you
|
||||
may need to add "+DAportable" to CC.
|
||||
|
||||
|
||||
- IRIX 6.5.4
|
||||
- IRIX 6.5.8
|
||||
Compiler: /bin/cc
|
||||
version: MIPSpro Compilers: Version 7.2.1
|
||||
Compiler:
|
||||
version: gcc version 2.95.2
|
||||
|
||||
- HP/UX 11.00:
|
||||
- HP/UX 11.00 64 bit:
|
||||
- Compiler: /opt/ansic/bin/cc -Ae
|
||||
version: A.11.01.00
|
||||
|
||||
Configure with
|
||||
env CC="cc -Ae" ./configure
|
||||
|
||||
- NetBSD 1.3.3 (i386)
|
||||
Compiler: /usr/bin/cc
|
||||
Compiler: /usr/bin/cc
|
||||
|
||||
Ignore warnings about ``passing arg 3 of `tputs' from
|
||||
incompatible pointer type''.
|
||||
|
||||
- RedHat Linux 5.1 (?? i386)
|
||||
- RedHat Linux 5.2 (?? i386)
|
||||
- RedHat Linux 6.0 (Linux 2.2.10 i686)
|
||||
- RedHat Linux 6.1 (Linux 2.2.5-15 i686)
|
||||
- RedHat Linux 6.2 (Linux 2.2.16-3smp i686)
|
||||
- Compiler: cc
|
||||
version: egcs-1.1.2
|
||||
|
||||
- Slackware (Linux 2.0.35 i686)
|
||||
- Compiler: cc
|
||||
version: 2.7.2.3
|
||||
|
||||
- Solaris 2.6 (sparc)
|
||||
- Solaris 7 (sparc)
|
||||
- Compiler: /opt/SUNWspro/bin/cc
|
||||
version: WorkShop Compilers 5.0
|
||||
|
||||
- Compiler: gcc
|
||||
version: egcs-1.1.2
|
||||
|
||||
=============
|
||||
= OLD NOTES =
|
||||
=============
|
||||
|
||||
XXX: clean up to match reality
|
||||
------------------------------
|
||||
|
||||
- RedHat Linux 5.0 (i386)
|
||||
Compiler: cc
|
||||
|
||||
- Solaris 2.5 (sparc)
|
||||
- Solaris 7 (x86)
|
||||
Compiler: /opt/SUNWspro/bin/cc
|
||||
version: SC3.0 15 Dec 1993
|
||||
version: WorkShop Compilers 5.0
|
||||
Compiler: gcc
|
||||
version: egcs-1.1.2
|
||||
version: gcc 2.8.1
|
||||
version: gcc 2.95.1
|
||||
|
||||
- Solaris 7 (sparc) 64 bit
|
||||
Compiler: /opt/SUNWspro/bin/cc -xarch=v9
|
||||
version: WorkShop Compilers 5.0
|
||||
|
||||
- SunOS 4
|
||||
Compiler: gcc -lresolv
|
||||
version:
|
||||
|
||||
- SuSE Linux
|
||||
Compiler: gcc
|
||||
version:
|
||||
|
||||
/usr/bin/ftp on SuSE Linux 6.4 is this ftp client.
|
||||
|
||||
May need `gcc -L/usr/lib/termcap' if tgetent() et al aren't found.
|
||||
|
||||
- Ultrix 4.5
|
||||
Compiler: cc
|
||||
version: MIPS C Compiler 3.0
|
||||
Compiler: gcc
|
||||
version: 2.7.2.2
|
@ -1,33 +0,0 @@
|
||||
# $Id: Makefile.in,v 1.6 1999/11/13 01:18:22 lukem Exp $
|
||||
#
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
SHELL = /bin/sh
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
|
||||
SUBDIRS = libedit libukem src
|
||||
|
||||
all: ftp
|
||||
|
||||
ftp: @LIBEDIT@ @LIBUKEM@
|
||||
( cd src; ${MAKE} )
|
||||
|
||||
libedit.a:
|
||||
( cd libedit; ${MAKE} )
|
||||
|
||||
libukem.a:
|
||||
( cd libukem; ${MAKE} )
|
||||
|
||||
install clean:
|
||||
@for i in ${SUBDIRS}; do \
|
||||
( echo "$@ ===> $$i" ; cd $$i ; ${MAKE} $@ ); \
|
||||
done
|
||||
|
||||
distclean: clean
|
||||
@for i in ${SUBDIRS}; do \
|
||||
( echo "$@ ===> $$i" ; cd $$i ; ${MAKE} $@ ); \
|
||||
done
|
||||
rm -f Makefile config.cache config.log config.status config.h
|
@ -1,84 +0,0 @@
|
||||
This is a brief description of the new features and fixes added to
|
||||
lukemftp-1.5 since the release of lukemftp-1.4. As always, the manual
|
||||
page (src/ftp.cat1) is the place to look for complete descriptions.
|
||||
|
||||
* Add new commands:
|
||||
features list remote features supported by servers
|
||||
mlsd machine parseable directory listing
|
||||
mlst machine parseable file listing
|
||||
remopts set options on remote features
|
||||
|
||||
These require support in the remote server for the ftp extensions
|
||||
described in RFC 2389 and draft-ietf-ftpext-mlst-11.
|
||||
|
||||
* Fix support for the --program-prefix and --program-suffix configure
|
||||
options.
|
||||
|
||||
---
|
||||
This is a brief description of the new features and fixes added to
|
||||
lukemftp-1.4 since the release of lukemftp-1.3. As always, the manual
|
||||
page (src/ftp.cat1) is the place to look for complete descriptions.
|
||||
|
||||
* Fix compilation problems on various non 4.4BSD derived platforms which
|
||||
support IPv6, and on Linux systems which have strdup() as a macro.
|
||||
|
||||
* During auto-fetch, don't attempt to autologin a second time if the first
|
||||
time failed.
|
||||
|
||||
---
|
||||
This is a brief description of the new features and fixes added to
|
||||
lukemftp-1.3 since the release of lukemftp-1.2. As always, the manual
|
||||
page (src/ftp.cat1) is the place to look for complete descriptions.
|
||||
|
||||
* The `ls' command now uses the `LIST' directive instead of `NLST',
|
||||
in order to be compatible with RFC959.
|
||||
|
||||
* Add fget command, which reads a list of filenames to retrieve from
|
||||
the given file.
|
||||
|
||||
* Add support for uploading files on the command-line with `ftp -u'.
|
||||
|
||||
* Various fixes to the IPv6 support.
|
||||
|
||||
---
|
||||
This is a brief description of the new features and fixes added to
|
||||
lukemftp-1.2 since the release of lukemftp-1.1. As always, the manual
|
||||
page (src/ftp.cat1) is the place to look for complete descriptions.
|
||||
|
||||
* During remote completion, only send ``NLST'' instead of ``NLST .''
|
||||
when reading the list of files from the remote server; some servers
|
||||
don't like the trailing `.'.
|
||||
|
||||
* Support a leading ``[user@]'' for ``[user@]host[:][path]'' auto-fetches
|
||||
and ``[user@]host'' connections.
|
||||
|
||||
* Always compile in support for setting the type of service on transfers.
|
||||
Should speed up transfers on Linux systems.
|
||||
|
||||
* Improve performance of non-rate-limited transfers.
|
||||
|
||||
* Work around ftp servers that aren't Y2K compliant in returning the
|
||||
modification time of a file.
|
||||
|
||||
* Update the libedit library to support automatic and magic margins,
|
||||
allowing ftp's rprompt to move an extra character to the right.
|
||||
|
||||
---
|
||||
This is a brief description of the new features and fixes added to
|
||||
lukemftp-1.1 since the release of lukemftp-1.0. As always, the manual
|
||||
page (src/ftp.cat1) is the place to look for complete descriptions.
|
||||
|
||||
* Implemented `set prompt' and `set rprompt', which allow you to
|
||||
configure the prompt and right side prompt (respectively).
|
||||
Some tcsh(1) style `%' escapes are supported, including
|
||||
%. %c %/ %m %M %n
|
||||
|
||||
* Implemented restarting of file:/// and non-proxied http:// URLs
|
||||
(using -R)
|
||||
|
||||
* Correctly parse remote ports given as numbers that don't appear in
|
||||
the services(5) database.
|
||||
|
||||
* Prevent a couple of minor memory leaks
|
||||
|
||||
* Add missing compilation setting for SOCKS
|
@ -1,61 +0,0 @@
|
||||
WHAT IS LUKEMFTP?
|
||||
-----------------
|
||||
|
||||
`lukemftp' is what many users affectionately call the enhanced ftp
|
||||
client in NetBSD (http://www.netbsd.org). The `lukem' comes from
|
||||
the account name of the NetBSD developer who wrote most of the
|
||||
enhancements: Luke Mewburn <lukem@netbsd.org>.
|
||||
|
||||
This package is a `port' of the NetBSD ftp client to other systems.
|
||||
|
||||
The enhancements over the standard ftp client in 4.4BSD (and
|
||||
derivatives) include:
|
||||
* command-line editing within ftp
|
||||
* command-line fetching of URLS, including support for:
|
||||
- http proxies (c.f: $http_proxy, $ftp_proxy)
|
||||
- authentication
|
||||
* configurable prompt
|
||||
* context sensitive command and filename completion
|
||||
* dynamic progress bar
|
||||
* feature negotiation extensions from RFC 2389
|
||||
(c.f: `feat' and `remopts')
|
||||
* extensions to ftp from the IETF ftpext working group
|
||||
(c.f: `mlsd' and `mlst')
|
||||
* IPv6 support (from the WIDE project)
|
||||
* modification time preservation
|
||||
* paging of local and remote files, and of directory listings
|
||||
(c.f: `lpage', `page', `pdir')
|
||||
* passive mode support, with fallback to active mode
|
||||
* retrieval of filenames listed in a given file (c.f: `fget')
|
||||
* `set option' override of ftp environment variables
|
||||
* socks4/socks5 support
|
||||
* TIS Firewall Toolkit gate ftp proxy support (c.f: `gate')
|
||||
* transfer-rate throttling (c.f: `-T', `rate')
|
||||
* uploading of files on the command line (c.f: `-u')
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
Refer to `INSTALL' for more information on how to compile and install
|
||||
lukemftp.
|
||||
|
||||
|
||||
FEEDBACK / BUG REPORTS
|
||||
----------------------
|
||||
|
||||
Please email feedback back to the maintainer: <lukem@netbsd.org>.
|
||||
|
||||
|
||||
COPYRIGHT
|
||||
---------
|
||||
|
||||
lukemftp is covered by a BSD-style copyright notice. Please refer to
|
||||
the file `COPYING' for more information.
|
||||
|
||||
|
||||
AVAILABILITY
|
||||
------------
|
||||
|
||||
The primary ftp site for lukemftp is:
|
||||
ftp://ftp.netbsd.org/pub/NetBSD/misc/lukemftp/
|
@ -1,30 +0,0 @@
|
||||
Whilst a lot of the work in lukemftp (both the original sources in NetBSD
|
||||
and this port) was done by me (Luke Mewburn), it would not be as useable
|
||||
without the enhancements, fixes, or input from the following people:
|
||||
|
||||
Brian Stark <bstark1990@netscape.net>
|
||||
Chris G. Demetriou <cgd@netbsd.org>
|
||||
Christos Zoulas <christos@netbsd.org>
|
||||
Dan Winship <danw@mit.edu>
|
||||
Darren Reed <darrenr@pobox.com>
|
||||
David Carrel <carrel@netbsd.org>
|
||||
Giles Lean <giles@nemeton.com.au>
|
||||
Havard Eidnes <Havard.Eidnes@runit.sintef.no>
|
||||
ITOH Yasufumi <itohy@netbsd.org>
|
||||
Jason R. Thorpe <thorpej@netbsd.org>
|
||||
John Hawkinson <jhawk@mit.edu>
|
||||
Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
Jun-ichiro itojun Hagino <itojun@netbsd.org>
|
||||
Kimmo Suominen <kim@tac.nyc.ny.us>
|
||||
Klaus Klein <kleink@netbsd.org>
|
||||
Luke Mewburn <lukem@netbsd.org>
|
||||
Marc Horowitz <marc@mit.edu>
|
||||
Matthew R. Green <mrg@eterna.com.au>
|
||||
Matthias Pfaller <leo@dachau.marco.de>
|
||||
Matthias Scheler <tron@zhadum.de>
|
||||
Michael L. Hitch <osymh@terra.oscs.montana.edu>
|
||||
Scott Aaron Bamford <sab@ansic.net>
|
||||
Simon Burge <simonb@thistledown.com.au>
|
||||
Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
|
||||
Apologies to anyone I've missed.
|
@ -1,92 +0,0 @@
|
||||
/* $Id: acconfig.h,v 1.9 2002/06/10 01:27:13 lukem Exp $ */
|
||||
|
||||
@TOP@
|
||||
@BOTTOM@
|
||||
|
||||
/* Define if your compiler supports `long long' */
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */
|
||||
#undef HAVE_PRINTF_QD
|
||||
|
||||
/* Define if in_port_t exists */
|
||||
#undef HAVE_IN_PORT_T
|
||||
|
||||
/* Define if sa_family_t exists in <sys/socket.h> */
|
||||
#undef HAVE_SA_FAMILY_T
|
||||
|
||||
/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
|
||||
#undef HAVE_SOCKADDR_SA_LEN
|
||||
|
||||
/* Define if socklen_t exists */
|
||||
#undef HAVE_SOCKLEN_T
|
||||
|
||||
/* Define if AF_INET6 exists in <sys/socket.h> */
|
||||
#undef HAVE_AF_INET6
|
||||
|
||||
/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
|
||||
#undef HAVE_SOCKADDR_IN6
|
||||
|
||||
/* Define if `struct addrinfo' exists in <netdb.h> */
|
||||
#undef HAVE_ADDRINFO
|
||||
|
||||
/*
|
||||
* Define if <netdb.h> contains AI_NUMERICHOST et al.
|
||||
* Systems which only implement RFC2133 will need this.
|
||||
*/
|
||||
#undef HAVE_RFC2553_NETDB
|
||||
|
||||
/* Define if `struct direct' has a d_namlen element */
|
||||
#undef HAVE_D_NAMLEN
|
||||
|
||||
/* Define if h_errno exists in <netdb.h> */
|
||||
#undef HAVE_H_ERRNO_D
|
||||
|
||||
/* Define if fclose() is declared in <stdio.h> */
|
||||
#undef HAVE_FCLOSE_D
|
||||
|
||||
/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */
|
||||
#undef HAVE_GETPASS_D
|
||||
|
||||
/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
|
||||
#undef HAVE_OPTARG_D
|
||||
|
||||
/* Define if optind is declared in <stdlib.h> or <unistd.h> */
|
||||
#undef HAVE_OPTIND_D
|
||||
|
||||
/* Define if pclose() is declared in <stdio.h> */
|
||||
#undef HAVE_PCLOSE_D
|
||||
|
||||
/* Define if `long long' is supported and sizeof(off_t) >= 8 */
|
||||
#undef HAVE_QUAD_SUPPORT
|
||||
|
||||
/* Define if strptime() is declared in <time.h> */
|
||||
#undef HAVE_STRPTIME_D
|
||||
|
||||
/*
|
||||
* Define this if compiling with SOCKS (the firewall traversal library).
|
||||
* Also, you must define connect, getsockname, bind, accept, listen, and
|
||||
* select to their R-versions.
|
||||
*/
|
||||
#undef SOCKS
|
||||
#undef SOCKS4
|
||||
#undef SOCKS5
|
||||
#undef connect
|
||||
#undef getsockname
|
||||
#undef bind
|
||||
#undef accept
|
||||
#undef listen
|
||||
#undef select
|
||||
#undef dup
|
||||
#undef dup2
|
||||
#undef fclose
|
||||
#undef gethostbyname
|
||||
#undef getpeername
|
||||
#undef read
|
||||
#undef recv
|
||||
#undef recvfrom
|
||||
#undef rresvport
|
||||
#undef send
|
||||
#undef sendto
|
||||
#undef shutdown
|
||||
#undef write
|
257
contrib/lukemftp/aclocal.m4
vendored
257
contrib/lukemftp/aclocal.m4
vendored
@ -1,257 +0,0 @@
|
||||
dnl $Id: aclocal.m4,v 1.5 1999/11/13 10:50:39 lukem Exp $
|
||||
dnl
|
||||
|
||||
dnl
|
||||
dnl AC_MSG_TRY_COMPILE
|
||||
dnl
|
||||
dnl Written by Luke Mewburn <lukem@netbsd.org>
|
||||
dnl
|
||||
dnl Usage:
|
||||
dnl AC_MSG_TRY_COMPILE(Message, CacheVar, Includes, Code,
|
||||
dnl ActionPass [,ActionFail] )
|
||||
dnl
|
||||
dnl effectively does:
|
||||
dnl AC_CACHE_CHECK(Message, CacheVar,
|
||||
dnl AC_TRY_COMPILE(Includes, Code, CacheVar = yes, CacheVar = no)
|
||||
dnl if CacheVar == yes
|
||||
dnl AC_MESSAGE_RESULT(yes)
|
||||
dnl ActionPass
|
||||
dnl else
|
||||
dnl AC_MESSAGE_RESULT(no)
|
||||
dnl ActionFail
|
||||
dnl )
|
||||
dnl
|
||||
AC_DEFUN(AC_MSG_TRY_COMPILE, [
|
||||
AC_CACHE_CHECK($1, $2, [
|
||||
AC_TRY_COMPILE([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ])
|
||||
])
|
||||
if test "x[$]$2" = "xyes"; then
|
||||
$5
|
||||
else
|
||||
$6
|
||||
:
|
||||
fi
|
||||
])
|
||||
|
||||
dnl
|
||||
dnl AC_MSG_TRY_LINK
|
||||
dnl
|
||||
dnl Usage:
|
||||
dnl AC_MSG_TRY_LINK(Message, CacheVar, Includes, Code,
|
||||
dnl ActionPass [,ActionFail] )
|
||||
dnl
|
||||
dnl as AC_MSG_TRY_COMPILE, but uses AC_TRY_LINK instead of AC_TRY_COMPILE
|
||||
dnl
|
||||
AC_DEFUN(AC_MSG_TRY_LINK, [
|
||||
AC_CACHE_CHECK($1, $2, [
|
||||
AC_TRY_LINK([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ])
|
||||
])
|
||||
if test "x[$]$2" = "xyes"; then
|
||||
$5
|
||||
else
|
||||
$6
|
||||
:
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl
|
||||
dnl AC_LIBRARY_NET: #Id: net.m4,v 1.5 1997/11/09 21:36:54 jhawk Exp #
|
||||
dnl
|
||||
dnl Written by John Hawkinson <jhawk@mit.edu>. This code is in the Public
|
||||
dnl Domain.
|
||||
dnl
|
||||
dnl This test is for network applications that need socket() and
|
||||
dnl gethostbyname() -ish functions. Under Solaris, those applications need to
|
||||
dnl link with "-lsocket -lnsl". Under IRIX, they should *not* link with
|
||||
dnl "-lsocket" because libsocket.a breaks a number of things (for instance:
|
||||
dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of
|
||||
dnl IRIX).
|
||||
dnl
|
||||
dnl Unfortunately, many application developers are not aware of this, and
|
||||
dnl mistakenly write tests that cause -lsocket to be used under IRIX. It is
|
||||
dnl also easy to write tests that cause -lnsl to be used under operating
|
||||
dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which
|
||||
dnl uses -lnsl for TLI.
|
||||
dnl
|
||||
dnl This test exists so that every application developer does not test this in
|
||||
dnl a different, and subtly broken fashion.
|
||||
dnl
|
||||
dnl It has been argued that this test should be broken up into two seperate
|
||||
dnl tests, one for the resolver libraries, and one for the libraries necessary
|
||||
dnl for using Sockets API. Unfortunately, the two are carefully intertwined and
|
||||
dnl allowing the autoconf user to use them independantly potentially results in
|
||||
dnl unfortunate ordering dependancies -- as such, such component macros would
|
||||
dnl have to carefully use indirection and be aware if the other components were
|
||||
dnl executed. Since other autoconf macros do not go to this trouble, and almost
|
||||
dnl no applications use sockets without the resolver, this complexity has not
|
||||
dnl been implemented.
|
||||
dnl
|
||||
dnl The check for libresolv is in case you are attempting to link statically
|
||||
dnl and happen to have a libresolv.a lying around (and no libnsl.a).
|
||||
dnl
|
||||
AC_DEFUN(AC_LIBRARY_NET, [
|
||||
# Most operating systems have gethostbyname() in the default searched
|
||||
# libraries (i.e. libc):
|
||||
AC_CHECK_FUNC(gethostbyname, ,
|
||||
# Some OSes (eg. Solaris) place it in libnsl:
|
||||
AC_CHECK_LIB(nsl, gethostbyname, ,
|
||||
# Some strange OSes (SINIX) have it in libsocket:
|
||||
AC_CHECK_LIB(socket, gethostbyname, ,
|
||||
# Unfortunately libsocket sometimes depends on libnsl.
|
||||
# AC_CHECK_LIB's API is essentially broken so the following
|
||||
# ugliness is necessary:
|
||||
AC_CHECK_LIB(socket, gethostbyname,
|
||||
LIBS="-lsocket -lnsl $LIBS",
|
||||
AC_CHECK_LIB(resolv, gethostbyname),
|
||||
-lnsl)
|
||||
)
|
||||
)
|
||||
)
|
||||
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, ,
|
||||
AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl)))
|
||||
])
|
||||
|
||||
|
||||
dnl Checks for SOCKS firewall support.
|
||||
dnl
|
||||
dnl Written by Matthew R. Green <mrg@eterna.com.au>
|
||||
dnl
|
||||
AC_DEFUN(AC_LIBRARY_SOCKS, [
|
||||
AC_MSG_CHECKING(whether to support SOCKS)
|
||||
AC_ARG_WITH(socks,
|
||||
[ --with-socks Compile with SOCKS firewall traversal support.],
|
||||
[
|
||||
case "$withval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_CHECK_LIB(socks5, SOCKSconnect, [
|
||||
socks=5
|
||||
LIBS="-lsocks5 $LIBS"], [
|
||||
AC_CHECK_LIB(socks, Rconnect, [
|
||||
socks=4
|
||||
LIBS="-lsocks $LIBS"], [
|
||||
AC_MSG_ERROR(Could not find socks library. You must first install socks.) ] ) ] )
|
||||
;;
|
||||
esac
|
||||
],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
|
||||
if test "x$socks" = "x"; then
|
||||
AC_MSG_CHECKING(whether to support SOCKS5)
|
||||
AC_ARG_WITH(socks5,
|
||||
[ --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support.],
|
||||
[
|
||||
case "$withval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
socks=5
|
||||
if test "x$withval" = "xyes"; then
|
||||
withval="-lsocks5"
|
||||
else
|
||||
if test -d "$withval"; then
|
||||
if test -d "$withval/include"; then
|
||||
CFLAGS="$CFLAGS -I$withval/include"
|
||||
else
|
||||
CFLAGS="$CFLAGS -I$withval"
|
||||
fi
|
||||
if test -d "$withval/lib"; then
|
||||
withval="-L$withval/lib -lsocks5"
|
||||
else
|
||||
withval="-L$withval -lsocks5"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
LIBS="$withval $LIBS"
|
||||
# If Socks was compiled with Kerberos support, we will need
|
||||
# to link against kerberos libraries. Temporarily append
|
||||
# to LIBS. This is harmless if there is no kerberos support.
|
||||
TMPLIBS="$LIBS"
|
||||
LIBS="$LIBS $KERBEROS_LIBS"
|
||||
AC_TRY_LINK([],
|
||||
[ SOCKSconnect(); ],
|
||||
[],
|
||||
[ AC_MSG_ERROR(Could not find the $withval library. You must first install socks5.) ])
|
||||
LIBS="$TMPLIBS"
|
||||
;;
|
||||
esac
|
||||
],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$socks" = "x"; then
|
||||
AC_MSG_CHECKING(whether to support SOCKS4)
|
||||
AC_ARG_WITH(socks4,
|
||||
[ --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support.],
|
||||
[
|
||||
case "$withval" in
|
||||
no)
|
||||
AC_MSG_RESULT(no)
|
||||
;;
|
||||
*)
|
||||
AC_MSG_RESULT(yes)
|
||||
socks=4
|
||||
if test "x$withval" = "xyes"; then
|
||||
withval="-lsocks"
|
||||
else
|
||||
if test -d "$withval"; then
|
||||
withval="-L$withval -lsocks"
|
||||
fi
|
||||
fi
|
||||
LIBS="$withval $LIBS"
|
||||
AC_TRY_LINK([],
|
||||
[ Rconnect(); ],
|
||||
[],
|
||||
[ AC_MSG_ERROR(Could not find the $withval library. You must first install socks.) ])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
AC_MSG_RESULT(no)
|
||||
)
|
||||
fi
|
||||
|
||||
if test "x$socks" = "x4"; then
|
||||
AC_DEFINE(SOCKS)
|
||||
AC_DEFINE(SOCKS4)
|
||||
AC_DEFINE(connect, Rconnect)
|
||||
AC_DEFINE(getsockname, Rgetsockname)
|
||||
AC_DEFINE(bind, Rbind)
|
||||
AC_DEFINE(accept, Raccept)
|
||||
AC_DEFINE(listen, Rlisten)
|
||||
AC_DEFINE(select, Rselect)
|
||||
fi
|
||||
|
||||
if test "x$socks" = "x5"; then
|
||||
AC_DEFINE(SOCKS)
|
||||
AC_DEFINE(SOCKS5)
|
||||
AC_DEFINE(connect,SOCKSconnect)
|
||||
AC_DEFINE(getsockname,SOCKSgetsockname)
|
||||
AC_DEFINE(getpeername,SOCKSgetpeername)
|
||||
AC_DEFINE(bind,SOCKSbind)
|
||||
AC_DEFINE(accept,SOCKSaccept)
|
||||
AC_DEFINE(listen,SOCKSlisten)
|
||||
AC_DEFINE(select,SOCKSselect)
|
||||
AC_DEFINE(recvfrom,SOCKSrecvfrom)
|
||||
AC_DEFINE(sendto,SOCKSsendto)
|
||||
AC_DEFINE(recv,SOCKSrecv)
|
||||
AC_DEFINE(send,SOCKSsend)
|
||||
AC_DEFINE(read,SOCKSread)
|
||||
AC_DEFINE(write,SOCKSwrite)
|
||||
AC_DEFINE(rresvport,SOCKSrresvport)
|
||||
AC_DEFINE(shutdown,SOCKSshutdown)
|
||||
AC_DEFINE(listen,SOCKSlisten)
|
||||
AC_DEFINE(close,SOCKSclose)
|
||||
AC_DEFINE(dup,SOCKSdup)
|
||||
AC_DEFINE(dup2,SOCKSdup2)
|
||||
AC_DEFINE(fclose,SOCKSfclose)
|
||||
AC_DEFINE(gethostbyname,SOCKSgethostbyname)
|
||||
fi
|
||||
])
|
@ -1,275 +0,0 @@
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* $Id: config.h.in,v 1.28 2002/06/10 08:10:33 lukem Exp $ */
|
||||
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
#undef CLOSEDIR_VOID
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
#undef GETPGRP_VOID
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
|
||||
#undef F77_NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to the type of arg1 for select(). */
|
||||
#undef SELECT_TYPE_ARG1
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for select(). */
|
||||
#undef SELECT_TYPE_ARG234
|
||||
|
||||
/* Define to the type of arg5 for select(). */
|
||||
#undef SELECT_TYPE_ARG5
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
#undef VOID_CLOSEDIR
|
||||
|
||||
/* The number of bytes in a off_t. */
|
||||
#undef SIZEOF_OFF_T
|
||||
|
||||
/* Define if you have the err function. */
|
||||
#undef HAVE_ERR
|
||||
|
||||
/* Define if you have the fgetln function. */
|
||||
#undef HAVE_FGETLN
|
||||
|
||||
/* Define if you have the fparseln function. */
|
||||
#undef HAVE_FPARSELN
|
||||
|
||||
/* Define if you have the fseeko function. */
|
||||
#undef HAVE_FSEEKO
|
||||
|
||||
/* Define if you have the getaddrinfo function. */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
/* Define if you have the gethostbyname2 function. */
|
||||
#undef HAVE_GETHOSTBYNAME2
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#undef HAVE_GETNAMEINFO
|
||||
|
||||
/* Define if you have the getpassphrase function. */
|
||||
#undef HAVE_GETPASSPHRASE
|
||||
|
||||
/* Define if you have the getpgrp function. */
|
||||
#undef HAVE_GETPGRP
|
||||
|
||||
/* Define if you have the inet_ntop function. */
|
||||
#undef HAVE_INET_NTOP
|
||||
|
||||
/* Define if you have the inet_pton function. */
|
||||
#undef HAVE_INET_PTON
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
#undef HAVE_POLL
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#undef HAVE_SELECT
|
||||
|
||||
/* Define if you have the setprogname function. */
|
||||
#undef HAVE_SETPROGNAME
|
||||
|
||||
/* Define if you have the sl_init function. */
|
||||
#undef HAVE_SL_INIT
|
||||
|
||||
/* Define if you have the snprintf function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strlcat function. */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define if you have the strlcpy function. */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the strptime function. */
|
||||
#undef HAVE_STRPTIME
|
||||
|
||||
/* Define if you have the strsep function. */
|
||||
#undef HAVE_STRSEP
|
||||
|
||||
/* Define if you have the strtoll function. */
|
||||
#undef HAVE_STRTOLL
|
||||
|
||||
/* Define if you have the strunvis function. */
|
||||
#undef HAVE_STRUNVIS
|
||||
|
||||
/* Define if you have the strvis function. */
|
||||
#undef HAVE_STRVIS
|
||||
|
||||
/* Define if you have the timegm function. */
|
||||
#undef HAVE_TIMEGM
|
||||
|
||||
/* Define if you have the usleep function. */
|
||||
#undef HAVE_USLEEP
|
||||
|
||||
/* Define if you have the <arpa/nameser.h> header file. */
|
||||
#undef HAVE_ARPA_NAMESER_H
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
#undef HAVE_ERR_H
|
||||
|
||||
/* Define if you have the <libutil.h> header file. */
|
||||
#undef HAVE_LIBUTIL_H
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if you have the <paths.h> header file. */
|
||||
#undef HAVE_PATHS_H
|
||||
|
||||
/* Define if you have the <poll.h> header file. */
|
||||
#undef HAVE_POLL_H
|
||||
|
||||
/* Define if you have the <regex.h> header file. */
|
||||
#undef HAVE_REGEX_H
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define if you have the <sys/poll.h> header file. */
|
||||
#undef HAVE_SYS_POLL_H
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
#undef HAVE_TERMCAP_H
|
||||
|
||||
/* Define if you have the <util.h> header file. */
|
||||
#undef HAVE_UTIL_H
|
||||
|
||||
/* Define if you have the <vis.h> header file. */
|
||||
#undef HAVE_VIS_H
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
#undef HAVE_LIBNSL
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
#undef HAVE_LIBSOCKET
|
||||
|
||||
/* Define if you have the tinfo library (-ltinfo). */
|
||||
#undef HAVE_LIBTINFO
|
||||
|
||||
/* Define if you have the util library (-lutil). */
|
||||
#undef HAVE_LIBUTIL
|
||||
|
||||
/* Define if your compiler supports `long long' */
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */
|
||||
#undef HAVE_PRINTF_QD
|
||||
|
||||
/* Define if in_port_t exists */
|
||||
#undef HAVE_IN_PORT_T
|
||||
|
||||
/* Define if sa_family_t exists in <sys/socket.h> */
|
||||
#undef HAVE_SA_FAMILY_T
|
||||
|
||||
/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
|
||||
#undef HAVE_SOCKADDR_SA_LEN
|
||||
|
||||
/* Define if socklen_t exists */
|
||||
#undef HAVE_SOCKLEN_T
|
||||
|
||||
/* Define if AF_INET6 exists in <sys/socket.h> */
|
||||
#undef HAVE_AF_INET6
|
||||
|
||||
/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
|
||||
#undef HAVE_SOCKADDR_IN6
|
||||
|
||||
/* Define if `struct addrinfo' exists in <netdb.h> */
|
||||
#undef HAVE_ADDRINFO
|
||||
|
||||
/*
|
||||
* Define if <netdb.h> contains AI_NUMERICHOST et al.
|
||||
* Systems which only implement RFC2133 will need this.
|
||||
*/
|
||||
#undef HAVE_RFC2553_NETDB
|
||||
|
||||
/* Define if `struct direct' has a d_namlen element */
|
||||
#undef HAVE_D_NAMLEN
|
||||
|
||||
/* Define if h_errno exists in <netdb.h> */
|
||||
#undef HAVE_H_ERRNO_D
|
||||
|
||||
/* Define if fclose() is declared in <stdio.h> */
|
||||
#undef HAVE_FCLOSE_D
|
||||
|
||||
/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */
|
||||
#undef HAVE_GETPASS_D
|
||||
|
||||
/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
|
||||
#undef HAVE_OPTARG_D
|
||||
|
||||
/* Define if optind is declared in <stdlib.h> or <unistd.h> */
|
||||
#undef HAVE_OPTIND_D
|
||||
|
||||
/* Define if pclose() is declared in <stdio.h> */
|
||||
#undef HAVE_PCLOSE_D
|
||||
|
||||
/* Define if `long long' is supported and sizeof(off_t) >= 8 */
|
||||
#undef HAVE_QUAD_SUPPORT
|
||||
|
||||
/* Define if strptime() is declared in <time.h> */
|
||||
#undef HAVE_STRPTIME_D
|
||||
|
||||
/*
|
||||
* Define this if compiling with SOCKS (the firewall traversal library).
|
||||
* Also, you must define connect, getsockname, bind, accept, listen, and
|
||||
* select to their R-versions.
|
||||
*/
|
||||
#undef SOCKS
|
||||
#undef SOCKS4
|
||||
#undef SOCKS5
|
||||
#undef connect
|
||||
#undef getsockname
|
||||
#undef bind
|
||||
#undef accept
|
||||
#undef listen
|
||||
#undef select
|
||||
#undef dup
|
||||
#undef dup2
|
||||
#undef fclose
|
||||
#undef gethostbyname
|
||||
#undef getpeername
|
||||
#undef read
|
||||
#undef recv
|
||||
#undef recvfrom
|
||||
#undef rresvport
|
||||
#undef send
|
||||
#undef sendto
|
||||
#undef shutdown
|
||||
#undef write
|
4229
contrib/lukemftp/configure
vendored
4229
contrib/lukemftp/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,307 +0,0 @@
|
||||
dnl $Id: configure.in,v 1.37 2002/06/10 08:08:53 lukem Exp $
|
||||
dnl
|
||||
dnl configure.in --
|
||||
dnl process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
|
||||
AC_REVISION($Revision: 1.37 $)dnl
|
||||
|
||||
AC_INIT(lukemftp.h)
|
||||
|
||||
dnl Arguments for which features are included
|
||||
dnl
|
||||
AC_ARG_PROGRAM
|
||||
AC_ARG_ENABLE(editcomplete, [\
|
||||
--enable-editcomplete Turn on command line editing and completion.
|
||||
--disable-editcomplete Turn off command line editing and completion
|
||||
[default: enabled].],
|
||||
opt_editcomplete=$enableval,
|
||||
opt_editcomplete=yes)
|
||||
AC_ARG_ENABLE(ipv6, [\
|
||||
--enable-ipv6 Enable IPv6 support (if your OS supports it).
|
||||
--disable-ipv6 Disable IPv6 support (even if your OS supports it)
|
||||
[default: enabled].],
|
||||
opt_ipv6=$enableval,
|
||||
opt_ipv6=yes)
|
||||
|
||||
dnl Checks for programs.
|
||||
dnl
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_CC
|
||||
AC_PROG_AWK
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
AC_CHECK_PROGS(AR, ar)
|
||||
AC_AIX
|
||||
|
||||
|
||||
dnl Checks for libraries.
|
||||
dnl
|
||||
AC_CHECK_LIB(util, fparseln)
|
||||
if test $opt_editcomplete = yes; then
|
||||
AC_CHECK_LIB(tinfo, tgetent, ,
|
||||
AC_CHECK_LIB(termcap, tgetent, ,
|
||||
AC_CHECK_LIB(curses, tgetent, ,
|
||||
AC_CHECK_LIB(ncurses, tgetent))))
|
||||
AC_SEARCH_LIBS(el_init, edit, have_libedit=yes, have_libedit=no)
|
||||
fi
|
||||
AC_LIBRARY_NET
|
||||
AC_LIBRARY_SOCKS
|
||||
if test -n "$socks"; then
|
||||
if test $opt_ipv6 = yes; then
|
||||
echo "IPv6 is incompatible with socks, disabling IPv6 support"
|
||||
opt_ipv6=no
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
dnl Checks for header files.
|
||||
dnl
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(arpa/nameser.h err.h regex.h paths.h poll.h sys/poll.h \
|
||||
termcap.h util.h libutil.h vis.h)
|
||||
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl
|
||||
AC_HEADER_TIME
|
||||
AC_TYPE_OFF_T
|
||||
AC_CHECK_SIZEOF(off_t, 0)
|
||||
AC_MSG_TRY_LINK(for long long, ftp_cv_HAVE_LONG_LONG, [
|
||||
#include <sys/types.h>] , [
|
||||
long long X = 2, Y = 1, Z;
|
||||
Z = X / Y; ], [
|
||||
AC_DEFINE(HAVE_LONG_LONG, 1)
|
||||
have_long_long=yes], [have_long_long=no])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for in_port_t, ftp_cv_HAVE_IN_PORT_T, [
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h> ], [ in_port_t X ], [AC_DEFINE(HAVE_IN_PORT_T, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for sa_family_t, ftp_cv_HAVE_SA_FAMILY_T, [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> ], [ sa_family_t X ], [AC_DEFINE(HAVE_SA_FAMILY_T, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for sockaddr_in.sin_len, ftp_cv_HAVE_SOCKADDR_SA_LEN, [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h> ], [
|
||||
struct sockaddr_in sin;
|
||||
int X = sin.sin_len ], [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for socklen_t, ftp_cv_HAVE_SOCKLEN_T, [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> ], [ socklen_t X ], [AC_DEFINE(HAVE_SOCKLEN_T, 1)])
|
||||
|
||||
if test $opt_ipv6 = yes; then
|
||||
|
||||
AC_MSG_TRY_COMPILE(for AF_INET6, ftp_cv_HAVE_AF_INET6, [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h> ],
|
||||
[ int X = AF_INET6 ], [AC_DEFINE(HAVE_AF_INET6, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for struct sockaddr_in6, ftp_cv_HAVE_SOCKADDR_IN6, [
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h> ],
|
||||
[ struct sockaddr_in6 X ], [AC_DEFINE(HAVE_SOCKADDR_IN6, 1)])
|
||||
|
||||
fi
|
||||
|
||||
AC_MSG_TRY_COMPILE(for struct addrinfo, ftp_cv_HAVE_ADDRINFO, [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h> ],
|
||||
[ struct addrinfo X ], [AC_DEFINE(HAVE_ADDRINFO, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for d_namlen in struct dirent, ftp_cv_HAVE_D_NAMLEN, [
|
||||
#if HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
#else
|
||||
# define dirent direct
|
||||
# if HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif ], [
|
||||
struct dirent dp;
|
||||
int X = dp.d_namlen; ], [AC_DEFINE(HAVE_D_NAMLEN, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for h_errno declaration, ftp_cv_HAVE_H_ERRNO_D, [
|
||||
#include <netdb.h> ], [ int X = h_errno ], [AC_DEFINE(HAVE_H_ERRNO_D, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for fclose() declaration, ftp_cv_HAVE_FCLOSE_D, [
|
||||
#include <stdio.h> ], [ int (*X)() = fclose ], [AC_DEFINE(HAVE_FCLOSE_D, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for getpass() declaration, ftp_cv_HAVE_GETPASS_D, [
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h> ], [ char *(*X)() = getpass ], [
|
||||
AC_DEFINE(HAVE_GETPASS_D, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for optarg declaration, ftp_cv_HAVE_OPTARG_D, [
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h> ], [ char *X = optarg ], [AC_DEFINE(HAVE_OPTARG_D, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for optind declaration, ftp_cv_HAVE_OPTIND_D, [
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h> ], [ int X = optind ], [AC_DEFINE(HAVE_OPTIND_D, 1)])
|
||||
|
||||
AC_MSG_TRY_COMPILE(for pclose() declaration, ftp_cv_HAVE_PCLOSE_D, [
|
||||
#include <stdio.h> ], [ int (*X)() = pclose ], [AC_DEFINE(HAVE_PCLOSE_D, 1)])
|
||||
|
||||
|
||||
dnl Checks for library functions.
|
||||
dnl
|
||||
AC_REPLACE_FUNCS(err fgetln fseeko getaddrinfo getnameinfo inet_ntop inet_pton \
|
||||
mkstemp setprogname sl_init snprintf strdup strerror strlcat \
|
||||
strlcpy strptime strsep strunvis strvis timegm usleep)
|
||||
AC_CHECK_FUNCS(gethostbyname2 getpassphrase getpgrp memmove poll select)
|
||||
if test $ac_cv_func_getpgrp = yes; then
|
||||
AC_FUNC_GETPGRP
|
||||
fi
|
||||
if test $ac_cv_lib_util_fparseln != yes; then
|
||||
AC_REPLACE_FUNCS(fparseln)
|
||||
fi
|
||||
|
||||
LIBOBJS="$LIBOBJS glob.o"
|
||||
|
||||
if test $ac_cv_func_strptime = yes; then
|
||||
AC_MSG_TRY_COMPILE(for strptime() declaration, ftp_cv_HAVE_STRPTIME_D, [
|
||||
#include <time.h> ], [ char *X = strptime("", "", NULL) ],
|
||||
[AC_DEFINE(HAVE_STRPTIME_D, 1)])
|
||||
fi
|
||||
|
||||
if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
|
||||
|
||||
dnl We assume that if sprintf() supports %lld or %qd,
|
||||
dnl then all of *printf() does. If not, disable long long
|
||||
dnl support because we don't know how to display it.
|
||||
|
||||
AC_MSG_CHECKING(*printf() support for %lld)
|
||||
can_printf_longlong=no
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
char buf[100];
|
||||
sprintf(buf, "%lld", 4294967300LL);
|
||||
return (strcmp(buf, "4294967300"));
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
can_printf_longlong=yes
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [ : ])
|
||||
|
||||
if test $can_printf_longlong != yes; then
|
||||
AC_MSG_CHECKING(*printf() support for %qd)
|
||||
AC_TRY_RUN([
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
char buf[100];
|
||||
sprintf(buf, "%qd", 4294967300LL);
|
||||
return (strcmp(buf, "4294967300"));
|
||||
}
|
||||
], [
|
||||
AC_MSG_RESULT(yes)
|
||||
can_printf_longlong=yes
|
||||
AC_DEFINE(HAVE_PRINTF_QD, 1)
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
], [ : ])
|
||||
fi
|
||||
|
||||
if test $can_printf_longlong = yes; then
|
||||
AC_DEFINE(HAVE_QUAD_SUPPORT, 1)
|
||||
AC_REPLACE_FUNCS(strtoll)
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test $opt_editcomplete = yes; then
|
||||
if test $have_libedit = yes; then
|
||||
AC_MSG_TRY_COMPILE(for EL_RPROMPT in libedit,
|
||||
ftp_cv_have_libedit, [
|
||||
#include <histedit.h> ], [ int X = EL_RPROMPT ], [:],
|
||||
have_libedit=no )
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for working libedit)
|
||||
if test $have_libedit = no; then
|
||||
AC_MSG_RESULT(no - using my own)
|
||||
INCLUDES="-I\${srcdir}/../libedit $INCLUDES"
|
||||
LDFLAGS="-L../libedit $LDFLAGS"
|
||||
LIBS="-ledit $LIBS"
|
||||
LIBEDIT=libedit.a
|
||||
LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
else
|
||||
CFLAGS="-DNO_EDITCOMPLETE $CFLAGS"
|
||||
fi
|
||||
|
||||
if test $ac_cv_func_sl_init = yes; then
|
||||
AC_MSG_TRY_COMPILE(if sl_add() returns int, ftp_cv_INT_SL_ADD, [
|
||||
#include <stringlist.h> ], [ int f = sl_add((StringList *)0, "foo") ],
|
||||
[:] , [LIBOBJS="$LIBOBJS sl_init.o"])
|
||||
fi
|
||||
|
||||
|
||||
have_rfc2553_netdb=no
|
||||
if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then
|
||||
AC_MSG_TRY_COMPILE(for AI_NUMERICHOST,
|
||||
ftp_cv_have_ai_numerichost, [
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h> ],
|
||||
[ int X = AI_NUMERICHOST ], [ have_rfc2553_netdb=yes ])
|
||||
fi
|
||||
AC_MSG_CHECKING(for working getaddrinfo())
|
||||
if test $have_rfc2553_netdb = yes; then
|
||||
AC_DEFINE(HAVE_RFC2553_NETDB, 1)
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
if test $ac_cv_func_getaddrinfo = yes; then
|
||||
LIBOBJS="$LIBOBJS getaddrinfo.o"
|
||||
AC_MSG_RESULT(no - using local version)
|
||||
else
|
||||
AC_MSG_RESULT(using local version)
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if test $ac_cv_header_vis_h = yes; then
|
||||
AC_MSG_TRY_COMPILE(for VIS_WHITE in vis.h,
|
||||
ftp_cv_have_vis_white, [
|
||||
#include <sys/types.h>
|
||||
#include <vis.h> ], [ int X = VIS_WHITE ], [:],
|
||||
ac_cv_header_vis_h=no )
|
||||
fi
|
||||
|
||||
|
||||
if test -n "$LIBOBJS"; then
|
||||
INCLUDES="$INCLUDES -I\${srcdir}/../libukem"
|
||||
LDFLAGS="$LDFLAGS -L../libukem"
|
||||
LIBS="$LIBS -lukem"
|
||||
LIBUKEM=libukem.a
|
||||
LIBDEPENDS="$LIBDEPENDS ../libukem/libukem.a"
|
||||
fi
|
||||
|
||||
dnl Create the Makefiles
|
||||
dnl
|
||||
|
||||
AC_SUBST(INCLUDES)
|
||||
AC_SUBST(LIBEDIT)
|
||||
AC_SUBST(LIBUKEM)
|
||||
AC_SUBST(LIBDEPENDS)
|
||||
|
||||
AC_OUTPUT(Makefile libedit/Makefile libedit/makelist libukem/Makefile \
|
||||
src/Makefile)
|
File diff suppressed because it is too large
Load Diff
@ -1,251 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
transformbasename=""
|
||||
transform_arg=""
|
||||
instcmd="$mvprog"
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=""
|
||||
chgrpcmd=""
|
||||
stripcmd=""
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=""
|
||||
dst=""
|
||||
dir_arg=""
|
||||
|
||||
while [ x"$1" != x ]; do
|
||||
case $1 in
|
||||
-c) instcmd="$cpprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd="$stripprog"
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
|
||||
shift
|
||||
continue;;
|
||||
|
||||
*) if [ x"$src" = x ]
|
||||
then
|
||||
src=$1
|
||||
else
|
||||
# this colon is to work around a 386BSD /bin/sh bug
|
||||
:
|
||||
dst=$1
|
||||
fi
|
||||
shift
|
||||
continue;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ x"$src" = x ]
|
||||
then
|
||||
echo "install: no input file specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]; then
|
||||
dst=$src
|
||||
src=""
|
||||
|
||||
if [ -d $dst ]; then
|
||||
instcmd=:
|
||||
chmodcmd=""
|
||||
else
|
||||
instcmd=mkdir
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
|
||||
if [ -f $src -o -d $src ]
|
||||
then
|
||||
true
|
||||
else
|
||||
echo "install: $src does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ x"$dst" = x ]
|
||||
then
|
||||
echo "install: no destination specified"
|
||||
exit 1
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# If destination is a directory, append the input filename; if your system
|
||||
# does not like double slashes in filenames, you may need to add some logic
|
||||
|
||||
if [ -d $dst ]
|
||||
then
|
||||
dst="$dst"/`basename $src`
|
||||
else
|
||||
true
|
||||
fi
|
||||
fi
|
||||
|
||||
## this sed command emulates the dirname command
|
||||
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
# this part is taken from Noah Friedman's mkinstalldirs script
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if [ ! -d "$dstdir" ]; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-${defaultIFS}}"
|
||||
|
||||
oIFS="${IFS}"
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
IFS="${oIFS}"
|
||||
|
||||
pathcomp=''
|
||||
|
||||
while [ $# -ne 0 ] ; do
|
||||
pathcomp="${pathcomp}${1}"
|
||||
shift
|
||||
|
||||
if [ ! -d "${pathcomp}" ] ;
|
||||
then
|
||||
$mkdirprog "${pathcomp}"
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
pathcomp="${pathcomp}/"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ x"$dir_arg" != x ]
|
||||
then
|
||||
$doit $instcmd $dst &&
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
|
||||
else
|
||||
|
||||
# If we're going to rename the final executable, determine the name now.
|
||||
|
||||
if [ x"$transformarg" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
dstfile=`basename $dst $transformbasename |
|
||||
sed $transformarg`$transformbasename
|
||||
fi
|
||||
|
||||
# don't allow the sed command to completely eliminate the filename
|
||||
|
||||
if [ x"$dstfile" = x ]
|
||||
then
|
||||
dstfile=`basename $dst`
|
||||
else
|
||||
true
|
||||
fi
|
||||
|
||||
# Make a temp file name in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
|
||||
# Move or copy the file name to the temp name
|
||||
|
||||
$doit $instcmd $src $dsttmp &&
|
||||
|
||||
trap "rm -f ${dsttmp}" 0 &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits
|
||||
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $instcmd $src $dsttmp" command.
|
||||
|
||||
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
|
||||
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
|
||||
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
|
||||
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
|
||||
$doit $rmcmd -f $dstdir/$dstfile &&
|
||||
$doit $mvcmd $dsttmp $dstdir/$dstfile
|
||||
|
||||
fi &&
|
||||
|
||||
|
||||
exit 0
|
@ -1,403 +0,0 @@
|
||||
/* $Id: lukemftp.h,v 1.43 2002/06/10 08:13:01 lukem Exp $ */
|
||||
|
||||
#define FTP_PRODUCT "lukemftp"
|
||||
#define FTP_VERSION "1.6-beta2"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>
|
||||
|
||||
#include <arpa/ftp.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <netdb.h>
|
||||
#include <pwd.h>
|
||||
#include <setjmp.h>
|
||||
#include <signal.h>
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if HAVE_POLL
|
||||
# if HAVE_POLL_H
|
||||
# include <poll.h>
|
||||
# elif HAVE_SYS_POLL_H
|
||||
# include <sys/poll.h>
|
||||
# endif
|
||||
#elif HAVE_SELECT
|
||||
# define USE_SELECT
|
||||
#else
|
||||
# error "no poll() or select() found"
|
||||
#endif
|
||||
|
||||
#if HAVE_DIRENT_H
|
||||
# include <dirent.h>
|
||||
#else
|
||||
# define dirent direct
|
||||
# if HAVE_SYS_NDIR_H
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if HAVE_SYS_DIR_H
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if HAVE_NDIR_H
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if HAVE_ERR_H
|
||||
# include <err.h>
|
||||
#endif
|
||||
|
||||
#if USE_GLOB_H /* not set by configure; used by other build systems */
|
||||
# include <glob.h>
|
||||
#else
|
||||
# include "ftpglob.h"
|
||||
#endif
|
||||
|
||||
#if HAVE_PATHS_H
|
||||
# include <paths.h>
|
||||
#endif
|
||||
#ifndef _PATH_BSHELL
|
||||
#define _PATH_BSHELL "/bin/sh"
|
||||
#endif
|
||||
#ifndef _PATH_TMP
|
||||
#define _PATH_TMP "/tmp/"
|
||||
#endif
|
||||
|
||||
typedef struct _stringlist {
|
||||
char **sl_str;
|
||||
size_t sl_max;
|
||||
size_t sl_cur;
|
||||
} StringList;
|
||||
|
||||
StringList *sl_init(void);
|
||||
int sl_add(StringList *, char *);
|
||||
void sl_free(StringList *, int);
|
||||
char *sl_find(StringList *, char *);
|
||||
|
||||
#if HAVE_TERMCAP_H
|
||||
# include <termcap.h>
|
||||
#else
|
||||
int tgetent(char *, const char *);
|
||||
char *tgetstr(const char *, char **);
|
||||
int tgetflag(const char *);
|
||||
int tgetnum(const char *);
|
||||
char *tgoto(const char *, int, int);
|
||||
void tputs(const char *, int, int (*)(int));
|
||||
#endif
|
||||
|
||||
#if HAVE_UTIL_H
|
||||
# include <util.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LIBUTIL_H
|
||||
# include <libutil.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_VIS_H
|
||||
# include <vis.h>
|
||||
#else
|
||||
# include "ftpvis.h"
|
||||
#endif
|
||||
|
||||
#if ! HAVE_IN_PORT_T
|
||||
typedef unsigned short in_port_t;
|
||||
#endif
|
||||
|
||||
#if ! HAVE_SA_FAMILY_T
|
||||
typedef unsigned short sa_family_t;
|
||||
#endif
|
||||
|
||||
#if ! HAVE_SOCKLEN_T
|
||||
typedef unsigned int socklen_t;
|
||||
#endif
|
||||
|
||||
#if HAVE_AF_INET6 && HAVE_SOCKADDR_IN6
|
||||
# define INET6
|
||||
#endif
|
||||
|
||||
|
||||
#if ! HAVE_RFC2553_NETDB
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef EAI_ADDRFAMILY
|
||||
#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
|
||||
#undef EAI_AGAIN
|
||||
#define EAI_AGAIN 2 /* temporary failure in name resolution */
|
||||
#undef EAI_BADFLAGS
|
||||
#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
|
||||
#undef EAI_FAIL
|
||||
#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
|
||||
#undef EAI_FAMILY
|
||||
#define EAI_FAMILY 5 /* ai_family not supported */
|
||||
#undef EAI_MEMORY
|
||||
#define EAI_MEMORY 6 /* memory allocation failure */
|
||||
#undef EAI_NODATA
|
||||
#define EAI_NODATA 7 /* no address associated with hostname */
|
||||
#undef EAI_NONAME
|
||||
#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
|
||||
#undef EAI_SERVICE
|
||||
#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
|
||||
#undef EAI_SOCKTYPE
|
||||
#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
|
||||
#undef EAI_SYSTEM
|
||||
#define EAI_SYSTEM 11 /* system error returned in errno */
|
||||
|
||||
/* KAME extensions? */
|
||||
#undef EAI_BADHINTS
|
||||
#define EAI_BADHINTS 12
|
||||
#undef EAI_PROTOCOL
|
||||
#define EAI_PROTOCOL 13
|
||||
#undef EAI_MAX
|
||||
#define EAI_MAX 14
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef NI_MAXHOST
|
||||
#define NI_MAXHOST 1025
|
||||
#undef NI_MAXSERV
|
||||
#define NI_MAXSERV 32
|
||||
|
||||
#undef NI_NOFQDN
|
||||
#define NI_NOFQDN 0x00000001
|
||||
#undef NI_NUMERICHOST
|
||||
#define NI_NUMERICHOST 0x00000002
|
||||
#undef NI_NAMEREQD
|
||||
#define NI_NAMEREQD 0x00000004
|
||||
#undef NI_NUMERICSERV
|
||||
#define NI_NUMERICSERV 0x00000008
|
||||
#undef NI_DGRAM
|
||||
#define NI_DGRAM 0x00000010
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef AI_PASSIVE
|
||||
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
|
||||
#undef AI_CANONNAME
|
||||
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
|
||||
|
||||
/* KAME extensions ? */
|
||||
#undef AI_NUMERICHOST
|
||||
#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
|
||||
#undef AI_MASK
|
||||
#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef AI_ALL
|
||||
#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
|
||||
#undef AI_V4MAPPED_CFG
|
||||
#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
|
||||
#undef AI_ADDRCONFIG
|
||||
#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
|
||||
#undef AI_V4MAPPED
|
||||
#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
|
||||
|
||||
#endif /* ! HAVE_RFC2553_NETDB */
|
||||
|
||||
|
||||
#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 */
|
||||
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);
|
||||
void freeaddrinfo(struct addrinfo *);
|
||||
char *gai_strerror(int);
|
||||
|
||||
#endif /* ! HAVE_RFC2553_NETDB && ! HAVE_ADDRINFO */
|
||||
|
||||
|
||||
#if ! HAVE_D_NAMLEN
|
||||
# define DIRENT_MISSING_D_NAMLEN
|
||||
#endif
|
||||
|
||||
#if ! HAVE_H_ERRNO_D
|
||||
extern int h_errno;
|
||||
#endif
|
||||
#define HAVE_H_ERRNO 1 /* XXX: an assumption for now... */
|
||||
|
||||
#if ! HAVE_FCLOSE_D
|
||||
int fclose(FILE *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_GETPASS_D
|
||||
char *getpass(const char *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_OPTARG_D
|
||||
extern char *optarg;
|
||||
#endif
|
||||
|
||||
#if ! HAVE_OPTIND_D
|
||||
extern int optind;
|
||||
#endif
|
||||
|
||||
#if ! HAVE_PCLOSE_D
|
||||
int pclose(FILE *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_ERR
|
||||
void err(int, const char *, ...);
|
||||
void errx(int, const char *, ...);
|
||||
void warn(const char *, ...);
|
||||
void warnx(const char *, ...);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_FGETLN
|
||||
char *fgetln(FILE *, size_t *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_FSEEKO
|
||||
int fseeko(FILE *, off_t, int);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_FPARSELN
|
||||
# define FPARSELN_UNESCESC 0x01
|
||||
# define FPARSELN_UNESCCONT 0x02
|
||||
# define FPARSELN_UNESCCOMM 0x04
|
||||
# define FPARSELN_UNESCREST 0x08
|
||||
# define FPARSELN_UNESCALL 0x0f
|
||||
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);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_INET_PTON
|
||||
int inet_pton(int, const char *, void *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_MKSTEMP
|
||||
int mkstemp(char *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_SETPROGNAME
|
||||
const char *getprogname(void);
|
||||
void setprogname(const char *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_SNPRINTF
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STRDUP
|
||||
char *strdup(const char *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STRERROR
|
||||
char *strerror(int);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STRPTIME || ! HAVE_STRPTIME_D
|
||||
char *strptime(const char *, const char *, struct tm *);
|
||||
#endif
|
||||
|
||||
#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)
|
||||
# endif
|
||||
# if ! defined(QUAD_MAX)
|
||||
# define QUAD_MAX (0x7fffffffffffffffL)
|
||||
# endif
|
||||
# endif
|
||||
#else /* ! HAVE_QUAD_SUPPORT */
|
||||
# define NO_LONG_LONG 1
|
||||
#endif /* ! HAVE_QUAD_SUPPORT */
|
||||
|
||||
#if ! HAVE_TIMEGM
|
||||
time_t timegm(struct tm *);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_HSTRERROR
|
||||
char *strerror(int);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STRLCAT
|
||||
size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STRLCPY
|
||||
size_t strlcpy(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_STRSEP
|
||||
char *strsep(char **stringp, const char *delim);
|
||||
#endif
|
||||
|
||||
#if ! HAVE_MEMMOVE
|
||||
# define memmove(a,b,c) bcopy((b),(a),(c))
|
||||
/* XXX: add others #defines for borken systems? */
|
||||
#endif
|
||||
|
||||
#if HAVE_GETPASSPHRASE
|
||||
# define getpass getpassphrase
|
||||
#endif
|
||||
|
||||
#if ! defined(MIN)
|
||||
# define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#if ! defined(MAX)
|
||||
# define MAX(a, b) ((a) < (b) ? (b) : (a))
|
||||
#endif
|
||||
|
||||
#if ! defined(timersub)
|
||||
# define timersub(tvp, uvp, vvp) \
|
||||
do { \
|
||||
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
|
||||
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
|
||||
if ((vvp)->tv_usec < 0) { \
|
||||
(vvp)->tv_sec--; \
|
||||
(vvp)->tv_usec += 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if ! defined(S_ISLNK)
|
||||
# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
|
||||
#define EPOCH_YEAR 1970
|
||||
#define SECSPERHOUR 3600
|
||||
#define SECSPERDAY 86400
|
||||
#define TM_YEAR_BASE 1900
|
@ -1,28 +0,0 @@
|
||||
# $NetBSD: Makefile,v 1.30 2005/02/11 15:13:28 jmc Exp $
|
||||
# from: @(#)Makefile 8.2 (Berkeley) 4/3/94
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
PROG= ftp
|
||||
SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
|
||||
progressbar.c ruserpass.c util.c
|
||||
|
||||
# Uncomment the following to provide defaults for gate-ftp operation
|
||||
#
|
||||
#CPPFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
|
||||
|
||||
.if defined(SMALLPROG)
|
||||
CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT -DNO_AUTH -DNO_HELP -DNO_STATUS
|
||||
.else
|
||||
LDADD+= -ledit -ltermcap
|
||||
DPADD+= ${LIBEDIT} ${LIBTERMCAP}
|
||||
.endif
|
||||
|
||||
.if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
|
||||
CPPFLAGS+= -DINET6
|
||||
.endif
|
||||
|
||||
cmds.o fetch.o: version.h
|
||||
main.o: ftp_var.h
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -1,43 +0,0 @@
|
||||
#
|
||||
# $Id: Makefile.in,v 1.8 2000/08/08 07:04:27 lukem Exp $
|
||||
#
|
||||
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
SHELL = /bin/sh
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
bindir = @bindir@
|
||||
mandir = @mandir@
|
||||
transform = @program_transform_name@
|
||||
|
||||
mandircat1 = ${mandir}/cat1
|
||||
|
||||
CC = @CC@
|
||||
CFLAGS = -I${srcdir} -I${srcdir}/.. -I. -I.. @INCLUDES@ @CFLAGS@
|
||||
LIBS = @LIBS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
|
||||
PROG = ftp
|
||||
OBJS = cmds.o cmdtab.o complete.o domacro.o fetch.o ftp.o main.o \
|
||||
ruserpass.o util.o
|
||||
|
||||
all: ${PROG}
|
||||
|
||||
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}
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile
|
@ -1,25 +0,0 @@
|
||||
$Id: todo,v 1.30 2002/06/10 08:08:53 lukem Exp $
|
||||
|
||||
update NEWS, README, ...
|
||||
|
||||
at end of configure, show summary of options used and features found
|
||||
|
||||
if socks is defined, disable ipv6 and use own getaddrinfo()/getnameinfo()
|
||||
(for tron)
|
||||
|
||||
add locale autoconf checks
|
||||
|
||||
AC_CHECK_SIZEOF(off_t, 0) doesn't work on FreeBSD 4.0 because the
|
||||
test doesn't include <sys/types.h>. fix autoconf?
|
||||
|
||||
in configure, check for ansi c compiler and barf if it fails
|
||||
|
||||
check if we need #defines for memcpy() et al
|
||||
|
||||
check for utimes() decls [which system?]
|
||||
|
||||
possibly install editline.3 and editrc.5
|
||||
|
||||
system specific tests (to remove need for manual intervention):
|
||||
- sunos4
|
||||
LIBS+= -lresolv
|
@ -1,4 +1,10 @@
|
||||
Copyright 1999, 2000 Luke Mewburn <lukem@netbsd.org>. All rights reserved.
|
||||
$NetBSD: COPYING,v 1.7 2010/01/12 07:01:01 lukem Exp $
|
||||
|
||||
Copyright (c) 2001-2010 The NetBSD Foundation, Inc.
|
||||
All rights reserved.
|
||||
|
||||
This code is derived from software contributed to The NetBSD Foundation
|
||||
by Simon Burge, Luke Mewburn, and Christos Zoulas.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
@ -10,20 +16,24 @@ are met:
|
||||
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 Luke Mewburn.
|
||||
4. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
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.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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.
|
||||
|
||||
This product also contains software developed by other people, and you
|
||||
are advised to read the various source files to read the full details
|
||||
@ -32,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:
|
@ -1,3 +1,713 @@
|
||||
$NetBSD: ChangeLog,v 1.58 2010/01/12 06:58:57 lukem Exp $
|
||||
|
||||
Tue Jan 12 06:58:15 UTC 2010 lukem
|
||||
|
||||
* Release as "tnftp 20100108"
|
||||
|
||||
* Rename onoff() argument "bool" to "val".
|
||||
|
||||
Tue Jan 5 09:12:01 UTC 2010 lukem
|
||||
|
||||
* If ARG_MAX isn't defined, use the result from sysconf(_SC_ARG_MAX).
|
||||
Fixes build when using newer glibc.
|
||||
|
||||
* Add libnetbsd.la to the LIBADD for libedit.
|
||||
Fix provided by Adam Sampson.
|
||||
|
||||
Mon Jan 4 06:28:07 UTC 2010 lukem
|
||||
|
||||
* Distribute various files not shipped by default automake rules,
|
||||
to use 'make dist' instead of 'cvs export'.
|
||||
|
||||
Wed Dec 30 00:12:47 UTC 2009 lukem
|
||||
|
||||
* Release as "tnftp 20091122"
|
||||
|
||||
Sun Nov 15 10:14:44 UTC 2009 lukem
|
||||
|
||||
* Merge NetBSD ftp from 20090520 to 20090915. Change:
|
||||
- Rename internal getline() to get_line() to avoid
|
||||
conflict with libc with former.
|
||||
- Avoid a NULL dereference in an error message.
|
||||
|
||||
Sat Nov 14 09:21:19 UTC 2009 lukem
|
||||
|
||||
* Convert to automake & libtool.
|
||||
|
||||
Sat Jun 6 07:17:38 UTC 2009 lukem
|
||||
|
||||
* Release as "tnftp 20090606"
|
||||
|
||||
Fri May 22 01:11:15 UTC 2009 lukem
|
||||
|
||||
* configure fixes:
|
||||
- Add the time.h headers to accheck_includes, for the strptime check.
|
||||
- Remove the check for el_init in libedit; we're always replacing
|
||||
the library and the presence of strvis() in some versions
|
||||
confuses other checks.
|
||||
|
||||
Wed May 20 13:47:43 UTC 2009 lukem
|
||||
|
||||
* Release as "tnftp 20090520"
|
||||
|
||||
* Merge NetBSD ftp from 20070722 to 20090520. Changes:
|
||||
- Only attempt to el_parse() a command unknown by the default
|
||||
parser if editing is enabled.
|
||||
Fixes PR 38589.
|
||||
- Turn off the alarmtimer before resetting the SIGALRM handler
|
||||
back to SIG_DFL.
|
||||
Fixes PR 35630.
|
||||
- Add epsv6 and epsv to disable extended passive mode for ipv6 or
|
||||
both ipv4 and ipv6 respectively. This hack is due to our
|
||||
friends a Juniper Networks who break epsv in ipv6.
|
||||
Should be fixed in ScreenOS 6.2.X.
|
||||
- Improve parsing of chunked transfer chunks per RFC2616:
|
||||
- more stringent chunk-size parsing
|
||||
- ignore optional trailing ';chunk-ext' stuff, instead of barfing
|
||||
- detect EOF before final \r\n.
|
||||
- Use the service name to getaddrinfo() (along with the host
|
||||
name), so that features such as DNS Service Discovery have a
|
||||
better chance of working.
|
||||
Display the service name in various status & error messages.
|
||||
- Don't getservbyname() the :port component of a URL; RFC 3986
|
||||
says it's just an unsigned number, not a service name.
|
||||
- Fix numerous WARNS=4 issues (-Wcast-qual -Wsign-compare).
|
||||
- Fix -Wshadow issues
|
||||
- Update copyrights
|
||||
- Remove clause 3 and 4 from TNF licenses
|
||||
- Rename HAVE_STRUCT_SOCKADDR_SA_LEN to
|
||||
HAVE_STRUCT_SOCKADDR_IN_SIN_LEN to accurately reflect the
|
||||
structure member being used.
|
||||
- Use AF_INET instead of AF_UNSPEC as the default family if
|
||||
!defined(INET6).
|
||||
|
||||
* configure improvements:
|
||||
- Style tweaks.
|
||||
- Use AC_LANG_PROGRAM() instead of AC_LANG_SOURCE()
|
||||
- Add a check for strptime() requiring separators between
|
||||
conversions, and use our replacement one if it does.
|
||||
|
||||
Sat Dec 20 15:28:24 UTC 2008 lukem
|
||||
|
||||
* configure improvements:
|
||||
- Move IPv6 check from tnftp.h to configure.ac (as per tnftpd).
|
||||
- Rework option descriptions.
|
||||
- Highlight when tests are for a specific option.
|
||||
- Move configuration results to the end of the file.
|
||||
- Display $prefix in configure results.
|
||||
|
||||
Fri Aug 15 03:03:36 UTC 2008 lukem
|
||||
|
||||
* Add a "Configuration results" display at the end of configure.
|
||||
Cosmetic tweaks.
|
||||
|
||||
Fri Feb 29 09:45:56 UTC 2008 lukem
|
||||
|
||||
* Support @EXEEXT@ for Cygwin (etc).
|
||||
|
||||
Mon Aug 6 04:55:19 UTC 2007 lukem
|
||||
|
||||
* Release as "tnftp 20070806"
|
||||
|
||||
* Add a NEWS file.
|
||||
|
||||
* Reduce differences between NetBSD-ftp and local copy.
|
||||
|
||||
* Merge NetBSD ftp from 20070605 to 20070722.
|
||||
Changes:
|
||||
- Document about:ftp and about:version.
|
||||
|
||||
* Add autoconf check for (Dante) SOCKS5.
|
||||
(Needs run-time testing and more portability testing.)
|
||||
|
||||
Mon Jul 23 11:44:42 UTC 2007 lukem
|
||||
|
||||
* Don't use non-standard: u_char u_short u_int.
|
||||
Use uint32_t instead of u_int32_t.
|
||||
|
||||
* Consistently use AS_CASE() and AS_IF() in configure.ac.
|
||||
|
||||
* Don't use defined() with HAVE_DECL_xxx.
|
||||
Use `LL' instead of `L' suffix for fallback
|
||||
defines of LLONG_MIN and LLONG_MAX.
|
||||
|
||||
Sun Jul 22 12:00:17 UTC 2007 lukem
|
||||
|
||||
* Include <arpa/nameser.h> if available, and provide fallback #defines.
|
||||
|
||||
* Sync with lib/libc/inet/inet_pton.c 1.3:
|
||||
* Sync to bind 9.3.x version
|
||||
* Update ISC copyright
|
||||
* Fix some lint
|
||||
|
||||
* Sync with lib/libc/inet/inet_ntop.c 1.3:
|
||||
* Sync to bind 9.3.x version
|
||||
* Update ISC copyright
|
||||
* Use socklen_t instead of size_t
|
||||
* Use snprintf() instead of SPRINTF()
|
||||
* Improve detection of various boundary conditions
|
||||
|
||||
* Sync to NetBSD glob.h 1.21, glob.c 1.16:
|
||||
* Standards compliance fix
|
||||
* De-lint
|
||||
* Don't overflow when DEBUG is defined.
|
||||
|
||||
* Sync fgetln.c to tools/compat/fgetln.c 1.7:
|
||||
* Clause 3 removal.
|
||||
|
||||
* Sync to config.guess 2007-07-22, config.sub 2007-06-28.
|
||||
|
||||
* Consistency tweaks in configure help strings.
|
||||
|
||||
* Add check for struct sockaddr.sa_len.
|
||||
Change tests for HAVE_foo to defined(HAVE_foo).
|
||||
Replace HAVE_SOCKADDR_SA_LEN with HAVE_STRUCT_SOCKADDR_SA_LEN.
|
||||
|
||||
* Remove pretence of supporting SOCKS for now;
|
||||
no test system is available, and the old
|
||||
autoconf 2.13 support wasn't upgraded to 2.61.
|
||||
|
||||
* configure.ac style consistency tweaks.
|
||||
Move autoconf aux files from ./ to build-aux/
|
||||
|
||||
* Remove duplicate HAVE_STRERROR replacement in tnftp.h.
|
||||
|
||||
Thu Jun 7 04:47:47 UTC 2007 lukem
|
||||
|
||||
* Merge NetBSD ftp from 20070510 to 20070605. Changes:
|
||||
- Enforce restriction that (http) proxied URL fetchs don't
|
||||
support being restarted at this time.
|
||||
Addresses NetBSD Problem Report 28697.
|
||||
- Display times in RFC2822 form rather than using ctime(3),
|
||||
since the former is more explicit about the timezone offset.
|
||||
- main: call tzset() to ensure TZ is setup for other <time.h>
|
||||
functions.
|
||||
- remotemodtime(): use strptime() to parse the reply.
|
||||
- fetch_url(): ensure struct tm is zeroed before calling
|
||||
strptime().
|
||||
- Modify parse_url() to consistently strip the leading `/'
|
||||
off ftp URLs.
|
||||
Fixes NetBSD Problem Report 17617.
|
||||
- Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be
|
||||
consistent with the style in the RFC index.
|
||||
- Refer to RFC3916 instead of 1738 or 2732.
|
||||
- Expand the list of supported RFCs in ftp(1) to contain the
|
||||
document name as well.
|
||||
|
||||
Fri May 11 04:39:55 UTC 2007 lukem
|
||||
|
||||
* Update INSTALL and COPYING.
|
||||
|
||||
* Rename HAVE_QUAD_SUPPORT to HAVE_PRINTF_LONG_LONG, and only
|
||||
require support for 'long long' in that check rather than
|
||||
needing sizeof(off_t)>=8, as some systems have a separate
|
||||
off64_t when Large File Support is enabled.
|
||||
|
||||
* config.guess: treat 'i86xen:SunOS:5.*' as 'i86pc:SunOS:5.*'
|
||||
|
||||
Thu May 10 15:23:33 UTC 2007 lukem
|
||||
|
||||
* Remove checks for util.h and libutil.h, and replacement for
|
||||
fparseln(), since fparseln() isn't used any more.
|
||||
|
||||
* Merge NetBSD ftp from 20070418 to 20070510. Changes:
|
||||
- Switch from fparseln() to the internal getline() when
|
||||
parsing HTTP headers. Makes ftp a bit more portable
|
||||
(not needing fparseln()) at the expense of not supporting
|
||||
arbitrary long header lines, which I'm not concerned about
|
||||
because we don't support header line continuation either...
|
||||
- Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659.
|
||||
- Fix misplaced const.
|
||||
- Implement copy_bytes() to copy bytes from one fd to another
|
||||
via the provided buffer, with optional rate-limiting and
|
||||
hash-mark printing, using one loop and handle short writes.
|
||||
Refactor sendrequest() and recvrequest() to use copy_data().
|
||||
Addresses NetBSD Problem Report 15943.
|
||||
|
||||
Wed May 9 05:24:55 UTC 2007 lukem
|
||||
|
||||
* Fix typo in poll()-based implementation of usleep() replacement.
|
||||
|
||||
Wed May 9 04:58:50 UTC 2007 lukem
|
||||
|
||||
* Rename configure.in to configure.ac, as the latter is the
|
||||
preferred name in autoconf 2.61.
|
||||
|
||||
* Convert from autoconf 2.13 to 2.61:
|
||||
* Use a consistent quoting mechanism.
|
||||
* Use modern autoconf macros, #define names, etc.
|
||||
* Search for more header files, and only #include if found.
|
||||
* Remove old-style config.h.in generation.
|
||||
This may fix various tests on platforms such as FreeBSD and OS X.
|
||||
|
||||
* Add -Wl,-search_paths_first to LDFLAGS on OS X (Darwin) if the
|
||||
linker supports it. This is needed so we use our libedit
|
||||
rather than the system one.
|
||||
|
||||
XXX: SOCKS support is currently disabled until I update the
|
||||
autoconf support.
|
||||
|
||||
Mon Apr 23 06:04:26 UTC 2007 lukem
|
||||
|
||||
* Merge NetBSD ftp from 20050610 to 20070418. Changes:
|
||||
- Add '-s srcaddr'.
|
||||
- Use IEC 60027-2 2^N based "KiB", "MiB" (etc) instead of
|
||||
10^n "KB", "MB", ...
|
||||
- Recognize 307 redirect code.
|
||||
- Suppress printing non-COMPLETE reply strings when EPSV/EPRT
|
||||
fails and we fall-back to PASV/PORT. Should fix a problem
|
||||
with the emacs ftp wrapper.
|
||||
- Fix display of 'Continue with <cmd>' messages.
|
||||
- Prevent segfaults in .netrc parsing.
|
||||
- Flush stdout before each command; ftp as slave process on
|
||||
a pipe should work.
|
||||
- getpass() can return NULL in some implementations; cope.
|
||||
- Support '-q quittime' when waiting for server replies.
|
||||
- Various spelling & grammatical fixes in the manual.
|
||||
- Plug some memory leaks.
|
||||
- If a file upload (via -u) fails, return an non-zero exit
|
||||
value based on the index of the file that caused the
|
||||
problem (a la auto-fetch retrieval).
|
||||
- Coverity fixes for CIDs: 873 874 875 1447 1448 2194 2195 3610
|
||||
- Don't remove trailing character during auth_url()
|
||||
- Fix progressbar display on narrow terminals (<43 columns)
|
||||
|
||||
Fri Mar 16 06:00:14 UTC 2007 lukem
|
||||
|
||||
* Change the return value of the replacement gai_strerror()
|
||||
from "char *" to "const char *", to match the current
|
||||
standards.
|
||||
Problem noted by Thomas Klausner.
|
||||
|
||||
Thu Oct 26 07:24:22 UTC 2006 lukem
|
||||
|
||||
* Correctly parse "AM" and "PM" in the replacement strptime().
|
||||
Problem noted by Kathryn Hogg.
|
||||
|
||||
Sat Jun 25 06:27:00 UTC 2005 lukem
|
||||
|
||||
* Release as "tnftp 20050625"
|
||||
|
||||
* Simplify the detection & replacement of dirname() and fparseln()
|
||||
and just use AC_REPLACE_FUNCS.
|
||||
(We don't care if the vendor has a working version in -lgen or -lutil
|
||||
instead of -lc; they'll get our replacement version in that case).
|
||||
Fixes build issue on older Darwin where the previous autoconf check
|
||||
wouldn't find dirname() in the default system libraries.
|
||||
|
||||
* Only provide a prototype for dirname() if we can't find one in
|
||||
<libgen.h>
|
||||
|
||||
* Search for NS_IN6ADDRSZ instead of IN6ADDRSZ, since we use the
|
||||
former and not the latter and older Darwin has the former.
|
||||
(This allows INET6 support to be enabled on Darwin 7.9.0)
|
||||
|
||||
Mon Jun 13 09:22:13 UTC 2005 lukem
|
||||
|
||||
* Tweak SOCKS5 support:
|
||||
acconfig.h:
|
||||
- fix a comment
|
||||
- ensure close() is replaced
|
||||
- list entries in the same order as aclocal.m4
|
||||
(and the SOCKS5 FAQ)
|
||||
aclocal.m4:
|
||||
- ensure getpeername() is replaced
|
||||
- don't replace listen() twice
|
||||
|
||||
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
|
||||
|
||||
* Release "tnftp 20050514"
|
||||
|
||||
* Fail if we can't find a library with tgetent (needed for libedit).
|
||||
NetBSD PR pkg/28925.
|
||||
* Improve quoting when using various autoconf macros.
|
||||
|
||||
* Merge NetBSD-ftp 20050513:
|
||||
- Correct the "optlen" argument passed to getsockopt(3) and
|
||||
setsockopt(3) in various places. Fixes a problem noted by
|
||||
Allen Briggs.
|
||||
- Improve warning printed when connect(2) for the data
|
||||
channel fails.
|
||||
|
||||
Wed May 11 04:19:43 UTC 2005 lukem
|
||||
|
||||
* Release "tnftp 20050511"
|
||||
|
||||
Wed May 11 04:10:01 UTC 2005 lukem
|
||||
|
||||
* Update the THANKS file.
|
||||
|
||||
* Only use poll() to implement xpoll() if it's available,
|
||||
otherwise attempt to use select() if that's available,
|
||||
otherwise #error.
|
||||
|
||||
* Detect if struct pollfd is available in <poll.h> or <sys/poll.h>.
|
||||
Improve consistency in use of autoconf macros.
|
||||
|
||||
Wed May 11 02:42:08 UTC 2005 lukem
|
||||
|
||||
* Merge NetBSD-ftp 20050511:
|
||||
- Use socklen_t instead of int as the 5th argument to
|
||||
getsockopt(). Improve invocation of setsockopt() and
|
||||
associated failure messages.
|
||||
|
||||
Wed May 11 01:46:29 UTC 2005 lukem
|
||||
|
||||
* Clean up RCSID usage in vendor-derived code, restoring original
|
||||
IDs where possible.
|
||||
|
||||
Wed May 11 00:08:16 UTC 2005 lukem
|
||||
|
||||
* Merge NetBSD-ftp 20050510:
|
||||
- Prevent an overly-long input line causing a core dump when
|
||||
editing is enabled.
|
||||
Issue noted by Ryoji Kanai in FreeBSD Problem Report # 77158.
|
||||
- Implement a timeout on the accept(2) in dataconn() and the
|
||||
connect(2) in xconnect() by temporarily setting O_NONBLOCK
|
||||
on the socket and using xpoll() to wait for the operation
|
||||
to succeed. The timeout used is the '-q quittime' argument
|
||||
(defaults to 60s for accept(2), and the system default for
|
||||
connect(2)). Idea inspired by discussion with Chuck Cranor.
|
||||
This may (indirectly) fix various problems with timeouts in
|
||||
active mode through broken firewalls.
|
||||
- Implement xpoll() as a wrapper around poll(2), to make it
|
||||
easier to replace on systems without a functional poll(2).
|
||||
Unconditionally use xpoll() instead of conditionally using
|
||||
select(2) or poll(2).
|
||||
- In fetch_url(), don't call freeaddrinfo(res0) too early, as
|
||||
we use pointers to its contents later in the function.
|
||||
Problem found by Onno van der Linden.
|
||||
- Fix ftp url reget when globs are being used.
|
||||
Provided by Mathieu Arnold <mat@FreeBSD.org>.
|
||||
- Factor out common string processing code eliminating static
|
||||
buffers, making functions that should be static be static,
|
||||
and cleaning up const usage. Added a guard against buffer
|
||||
overflow, but the domap function is a bit too complicated
|
||||
to tackle right now.
|
||||
- Clean up whitespace.
|
||||
- Expand description of http_proxy by suggesting the use of
|
||||
RFC 1738 '%xx' encoding for "unsafe URL" characters in
|
||||
usernames and passwords.
|
||||
|
||||
Wed Jan 5 05:53:59 UTC 2005 lukem
|
||||
|
||||
* For now, assume libedit is not up-to-date and use our own version.
|
||||
|
||||
* Merge libedit from NetBSD 20020605 to 20050105. Changes include:
|
||||
- Improve vi-mode.
|
||||
- Delete-previous-char and delete-next-char without an
|
||||
argument are not supposed to modify the yank buffer in
|
||||
emacs-mode.
|
||||
- Improve incremental searching.
|
||||
- Improve memory allocation & usage.
|
||||
- Move UCB-licensed code from 4-clause to 3-clause.
|
||||
- Make the tokenization functions publically available.
|
||||
- Various tty access bug-fixes.
|
||||
- Improve readline emulation.
|
||||
|
||||
Tue Jan 4 13:33:40 UTC 2005 lukem
|
||||
|
||||
* Unixware 7.1.1 implements RFC 2133 (Basic Socket Interface
|
||||
Extensions for IPv6) but not the successor RFC 2553. The configure
|
||||
script detects this and decides that tnftp needs to compile its own
|
||||
version of getaddrinfo(). This produces the error message
|
||||
/usr/include/netdb.h:248: `getaddrinfo' previously defined here
|
||||
because Unixware provides an implementation of getaddrinfo() in
|
||||
netdb.h instead of a prototype declaration :-/. Since netdb.h
|
||||
cannot be omitted, we will always get this definition and tnftp's
|
||||
version of getaddrinfo will always create a conflict. This ugly
|
||||
preprocessor hack works around the problem. Hints for a better
|
||||
solution welcome. Fix from pkgsrc/net/tnftp.
|
||||
|
||||
* Workaround poll() being a compatibility function on Darwin 7
|
||||
(MacOSX 10.3) by adding a custom test for _POLL_EMUL_H_ which
|
||||
is defined in poll.h on some MacOSX 10.3 systems. Not all 10.3
|
||||
systems have poll.h, so only do the poll() test if at least one
|
||||
of the header files is found. Fix from pkgsrc/net/tnftp.
|
||||
|
||||
* Add a utimes() replacement (using utime()) for Interix.
|
||||
From pkgsrc/net/tnftp.
|
||||
|
||||
Mon Jan 3 10:21:57 UTC 2005 lukem
|
||||
|
||||
* Release "tnftp 20050103"
|
||||
|
||||
* Merge NetBSD-ftp 20050103:
|
||||
- Forbid filenames returned from mget that aren't in (or below)
|
||||
the current directory. The previous behaviour (of trusting
|
||||
the remote server's response when retrieving the list of
|
||||
files to mget with prompting disabled) has been in ftp
|
||||
~forever, and has been a "known issue" for a long time.
|
||||
Recently an advisory was published by D.J. Bernstein on
|
||||
behalf of Yosef Klein warning of the problems with the
|
||||
previous behaviour, so to alleviate concern I've fixed
|
||||
this with a sledgehammer.
|
||||
- Remember the local cwd after any operation which may
|
||||
change it.
|
||||
- Use "remotecwd" instead of "remotepwd".
|
||||
- Add (unsigned char) cast to ctype functions
|
||||
- Ensure that "mname" is set in ls() and mls() so that an
|
||||
aborted confirm() prints the correct name.
|
||||
Problem highlighted & suggested fix from PR [bin/17766]
|
||||
by Steve McClellan.
|
||||
- If an ftp auto-fetch transfer is interrupted by SIGINT
|
||||
(usually ^C), exit with 130 instead of 1 (or rarely, 0).
|
||||
This allows an ftp auto-fetch in a shell loop to correctly
|
||||
terminate the loop.
|
||||
Should fix PR [pkg/26351], and possibly others.
|
||||
- Save approximately 8K by not including http authentication,
|
||||
extended status messages and help strings when the
|
||||
appropriate options are set.
|
||||
- Move UCB-licensed code from 4-clause to 3-clause licence.
|
||||
Patches provided by Joel Baker in PR 22365, verified by
|
||||
Alistair Crooks.
|
||||
- Always decode %xx in a url's user & pass components.
|
||||
- Only remember {WWW,Proxy}-Authenticate "Basic" challenges; no
|
||||
point in tracking any others since ftp doesn't support them.
|
||||
- Improve the parsing of HTTP responses.
|
||||
- Don't base64 encode the trailing NUL in the HTTP basic auth
|
||||
response. Problem noted by Eric Haszlakiewicz.
|
||||
- Improve parsing of HTTP response headers to be more RFC2616
|
||||
compliant, and skip LWS (linear white space; CR, LF, space,
|
||||
tab) and the end of lines and between the field name and
|
||||
the field value. This still isn't 100% compliant, since we
|
||||
don't support "multi line" responses at this time.
|
||||
This should fix PR [bin/22611] from TAMURA Kent (although I
|
||||
can't easily find a http server to reproduce the problem
|
||||
against.)
|
||||
- Fix a minor memory leak when parsing HTTP response headers.
|
||||
- Don't unnecessarily display a 401/407 error when running
|
||||
with -V. Fix from PR [bin/18535] by Jeremy Reed.
|
||||
- Don't warn about "ignored setsockopt" failures unless
|
||||
debugging is enabled. Suggested by Todd Vierling.
|
||||
- Allow empty passwords in ftp://user:@host/file auto-fetch
|
||||
URLs, per RFC 1738. Requested by Simon Poole.
|
||||
- correct URL syntax in comment
|
||||
- Note potentially surprising file-saving behaviour in case
|
||||
of HTTP redirects
|
||||
- -n is ignored for auto-fetch transfers
|
||||
- If connect(2) in xconnect() fails with EINTR, call select(2)
|
||||
on the socket until it's writable or it fails with something
|
||||
other than EINTR. This matches the behaviour in SUSv3, and
|
||||
prevents the problem when pressing ^T (SIGINFO, which is
|
||||
marked as restartable) during connection setup would cause
|
||||
ftp to fail with EADDRINUSE or EALREADY when the second
|
||||
connect(2) was attempted on the same socket. Problem found
|
||||
and solution provided by Maxime Henrion <mux@freebsd.org>.
|
||||
- Add -q to usage. From Kouichirou Hiratsuka in PR 26199.
|
||||
- PR/25566: Anders Magnusson: ftp(1) do not like large TCP
|
||||
windows. Limit it to 8M.
|
||||
|
||||
Mon Oct 6 01:23:03 UTC 2003 lukem
|
||||
|
||||
* configure.in improvements:
|
||||
- When testing for IN6ADDRSZ in <arpa/nameser.h>, pull in
|
||||
<sys/types.h> first. From Stoned Elipot <seb @ NetBSD>
|
||||
- Whitespace cleanup
|
||||
|
||||
Mon Aug 25 11:45:45 UTC 2003 lukem
|
||||
|
||||
* Release "tnftp 20030825"
|
||||
|
||||
* Add autoconf test for <sys/syslimits.h>; Cygwin needs it for ARG_MAX.
|
||||
Per discussion with Eugene Kotlyarov <ekot@protek36.esoo.ru>.
|
||||
|
||||
Thu Jul 31 07:30:00 UTC 2003 lukem
|
||||
|
||||
* release "tnftp 20030731"
|
||||
|
||||
* merge ftp from NetBSD 20030731 to 20030731b:
|
||||
- Work around broken ftp servers (notably ProFTPd) that can't
|
||||
even follow RFC 2389, and skip any amount of whitespace
|
||||
before a FEATure response. The RFC says 'single space' yet
|
||||
ProFTPd puts two. Noted by DervishD <raul@pleyades.net>.
|
||||
- Improve formatting of features[] debug dump.
|
||||
- Invalidate remote directory completion cache if any command
|
||||
which may change the remote contents completes successfully,
|
||||
including: del, mdel, ren, mkdir, rmdir, quote, and all
|
||||
upload commands. Patch from Yar Tikhiy <yar@freebsd.org>.
|
||||
|
||||
* merge ftp from NetBSD 20030228 to 20030731:
|
||||
- $FTPUSERAGENT overrides the HTTP User-Agent header.
|
||||
Based on patch from Douwe Kiela <virtus@wanadoo.nl>.
|
||||
- Add about:tnftp
|
||||
- Fix URL in about:netbsd
|
||||
- netbsd.org->NetBSD.org
|
||||
- strlcpy fix in fetch.c
|
||||
- Uppercase "URL"
|
||||
- fix a bogus error message when given a HTTP URL with a
|
||||
trailing slash
|
||||
- groff fixes in man page
|
||||
- tweak progressbar.c copyright; the stuff jason did in util.c
|
||||
wasn't migrated to this file
|
||||
- Don't coredump when printing '%n' in the prompt if there's
|
||||
no username yet.
|
||||
Fix from Maxim Konovalov <maxim@freebsd.org>
|
||||
|
||||
* Add test for HAVE_IN6ADDRSZ (which older Darwin is lacking),
|
||||
and only enable INET6 if it exists.
|
||||
Patch from Amitai Schlair <schmonz@schmonz.com>.
|
||||
|
||||
* Improve ipv6 check for older linux systems that don't provide
|
||||
sin6_scope_id.
|
||||
Patch from YAMANO Yuji <Yamano_Yuji@tk-bay.ogis-ri.co.jp>.
|
||||
|
||||
Fri Feb 28 10:57:30 UTC 2003 lukem
|
||||
|
||||
* tagged as "tnftp 2.0 beta1"
|
||||
|
||||
Fri Feb 28 10:07:07 UTC 2003 lukem
|
||||
|
||||
* renamed to `tnftp' (from `lukemftp')
|
||||
|
||||
* renamed `libukem' to `libnetbsd'
|
||||
|
||||
|
||||
Mon Jun 17 06:50:13 UTC 2002 lukem
|
||||
|
||||
* #if USE_GLOB_H, use <glob.h> instead of "ftpglob.h".
|
||||
Requested by Mike Heffner <mikeh@freebsd.org>
|
||||
|
||||
Mon Jun 10 08:12:35 UTC 2002 lukem
|
||||
|
||||
* crank FTP_VERSION from 1.6-beta1 to 1.6-beta2
|
||||
@ -223,7 +933,7 @@ Tue Oct 3 10:22:36 EST 2000 lukem
|
||||
Mon Sep 25 21:52:12 EST 2000 lukem
|
||||
|
||||
* crank to version 1.5 beta5
|
||||
|
||||
|
||||
Sun Sep 24 13:31:19 EST 2000 lukem
|
||||
|
||||
* merge ftp from NetBSD-current (20000924)
|
||||
@ -243,7 +953,7 @@ Sun Sep 24 13:31:19 EST 2000 lukem
|
||||
- in progressmeter() perform the check for foregroundproc() a
|
||||
little earlier
|
||||
- removed unused variable `items' in list_vertical()
|
||||
|
||||
|
||||
Sat Sep 23 15:43:34 EST 2000 lukem
|
||||
|
||||
* remove unused sverrno in warnx() and errx()
|
||||
@ -406,7 +1116,7 @@ Wed Aug 2 23:43:50 EST 2000 lukem
|
||||
* update from NetBSD-current (20000802):
|
||||
- rename NO_QUAD to NO_LONG_LONG, QUAD* -> LL* and add ULL*
|
||||
(unsigned) equivalents. name change suggested by Klaus
|
||||
Klein <kjk@netbsd.org>
|
||||
Klein <kjk@NetBSD.org>
|
||||
- change defined(BSD4_4) || HAVE_SIN_LEN tests into
|
||||
HAVE_SOCKADDR_SA_LEN, and set the latter if BSD4_4 exists
|
||||
|
||||
@ -451,7 +1161,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem
|
||||
- add support for FEAT and OPTS commands with `features' and
|
||||
`opts'. (from RFC 2389).
|
||||
- add support for MLST & MLSD (machine parseble listings)
|
||||
with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands.
|
||||
with 'mlst', 'mlsd' and 'pmlsd' (mlsd |$PAGER) commands.
|
||||
(from draft-ietf-ftpext-mlst-11)
|
||||
- rename remotesyst() to getremoteinfo(), and modify to parse
|
||||
the result from FEAT (if supported), and take into account
|
||||
@ -473,7 +1183,7 @@ Wed Jul 26 18:59:19 EST 2000 lukem
|
||||
- minor knf (indent goto labels by one space, etc).
|
||||
- simply various command usage handlers by assuming that
|
||||
argv != NULL except for quit() and disconnect().
|
||||
- errx?/warnx? audit. do not pass variable alone, use %s.
|
||||
- errx?/warnx? audit. do not pass variable alone, use %s.
|
||||
|
||||
* check for issetugid() and don't use in libedit if it doesn't exist.
|
||||
|
||||
@ -572,12 +1282,12 @@ Sun Jun 4 18:00:07 EST 2000 lukem
|
||||
- do not pass scoped IPv6 address notation on Host: directive,
|
||||
since scope identifier is local to the originating node.
|
||||
do not allow scoped IPv6 address notation in URL, if it is
|
||||
via proxy.
|
||||
via proxy.
|
||||
- fixes from cgd:
|
||||
* sanity check a length (otherwise certain bogus responses
|
||||
can crash ftp)
|
||||
* allow a transfer encoding type of `binary'; certain
|
||||
firewall vendors return this bogus type...
|
||||
firewall vendors return this bogus type...
|
||||
- make debugging output unambiguous on IPv6 numeric addrs
|
||||
(don't use host:port)
|
||||
- http://[::1]:8080/ is legal.
|
||||
@ -705,7 +1415,7 @@ Sun Nov 28 18:20:41 EST 1999 lukem
|
||||
- implement xsl_init() and xsl_add(); error checking forms of
|
||||
sl_{init,add}()
|
||||
- fix bug where the second press of <TAB> on an empty word (i.e, list
|
||||
all options) may have resulted in an strncmp() against NULL.
|
||||
all options) may have resulted in an strncmp() against NULL.
|
||||
(detected by _DIAGASSERT())
|
||||
- in cleanuppeer(), reset username to NULL after free()ing it.
|
||||
fixes [bin/8870] by Wolfgang Rupprecht <wolfgang@wsrcc.com>
|
||||
@ -985,7 +1695,7 @@ Mon Oct 4 10:57:41 EST 1999 lukem
|
||||
|
||||
* Add support for --{en,dis}able-editcomplete (defaults to enabled),
|
||||
which prevents libedit support from being compiled in.
|
||||
From Chris G. Demetriou <cgd@netbsd.org>
|
||||
From Chris G. Demetriou <cgd@NetBSD.org>
|
||||
|
||||
Sun Oct 3 16:49:01 EST 1999 lukem
|
||||
|
60
contrib/tnftp/INSTALL
Normal file
60
contrib/tnftp/INSTALL
Normal file
@ -0,0 +1,60 @@
|
||||
INSTALLATION INTRODUCTION
|
||||
-------------------------
|
||||
|
||||
This file describes how to compile and install tnftp on your system.
|
||||
|
||||
============================================
|
||||
= =
|
||||
= NOTE: You will need an ANSI C compiler. =
|
||||
= =
|
||||
============================================
|
||||
|
||||
|
||||
For most systems, execute the following to compile and install tnftp:
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
|
||||
A preformatted manual page (src/ftp.cat1) is also installed.
|
||||
If you wish to install the source (src/ftp.1), ensure that your system
|
||||
has up-to-date mandoc macros, such as those that are shipped with groff.
|
||||
|
||||
|
||||
CONFIGURATION OPTIONS
|
||||
---------------------
|
||||
|
||||
tnftp is configured using an `autoconf' generated `configure'
|
||||
script. `configure' supports the following options:
|
||||
|
||||
* The standard `autoconf configure' options, including:
|
||||
--prefix=PREFIX install architecture-independent files in PREFIX
|
||||
[/usr/local]
|
||||
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
|
||||
[same as prefix]
|
||||
--srcdir=DIR find the sources in DIR [configure dir or ..]
|
||||
BSD or GNU make may be required for this to work.
|
||||
|
||||
* Specific options:
|
||||
--enable-editcomplete Turn on command line editing and completion.
|
||||
(default: enabled)
|
||||
--enable-ipv6 Enable IPv6 support (if your OS supports it).
|
||||
(default: enabled)
|
||||
--disable-largefile omit support for large files
|
||||
--with-socks enable support for (Dante) SOCKS5 proxy
|
||||
|
||||
The following environment variables can be set to override various
|
||||
compiler related settings.
|
||||
CC=compiler specify name of the C compiler (default: gcc or cc)
|
||||
CFLAGS=flags specify flags to C compiler (default: -O -g or just -O)
|
||||
LDFLAGS=flags specify flags to linker (default: none)
|
||||
|
||||
This can be achieved with:
|
||||
env CC="compiler" CFLAGS="flags" LDFLAGS="flags" ./configure
|
||||
|
||||
|
||||
============================================
|
||||
= =
|
||||
= NOTE: You will need an ANSI C compiler. =
|
||||
= =
|
||||
============================================
|
||||
|
13
contrib/tnftp/Makefile.am
Normal file
13
contrib/tnftp/Makefile.am
Normal file
@ -0,0 +1,13 @@
|
||||
## $NetBSD: Makefile.am,v 1.2 2010/01/04 06:24:58 lukem Exp $
|
||||
|
||||
SUBDIRS = libnetbsd
|
||||
|
||||
if USE_LIBEDIT
|
||||
SUBDIRS += libedit
|
||||
endif
|
||||
|
||||
SUBDIRS += src
|
||||
|
||||
EXTRA_DIST = \
|
||||
todo \
|
||||
tnftp.h
|
726
contrib/tnftp/Makefile.in
Normal file
726
contrib/tnftp/Makefile.in
Normal file
@ -0,0 +1,726 @@
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
@USE_LIBEDIT_TRUE@am__append_1 = libedit
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/tnftp_config.h.in \
|
||||
$(top_srcdir)/configure COPYING ChangeLog INSTALL NEWS THANKS \
|
||||
buildaux/config.guess buildaux/config.sub buildaux/depcomp \
|
||||
buildaux/install-sh buildaux/ltmain.sh buildaux/missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = tnftp_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
|
||||
distdir dist dist-all distcheck
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = libnetbsd libedit src
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d "$(distdir)" \
|
||||
|| { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr "$(distdir)"; }; }
|
||||
am__relativize = \
|
||||
dir0=`pwd`; \
|
||||
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
|
||||
sed_rest='s,^[^/]*/*,,'; \
|
||||
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
|
||||
sed_butlast='s,/*[^/]*$$,,'; \
|
||||
while test -n "$$dir1"; do \
|
||||
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
|
||||
if test "$$first" != "."; then \
|
||||
if test "$$first" = ".."; then \
|
||||
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
|
||||
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
|
||||
else \
|
||||
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
|
||||
if test "$$first2" = "$$first"; then \
|
||||
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
|
||||
else \
|
||||
dir2="../$$dir2"; \
|
||||
fi; \
|
||||
dir0="$$dir0"/"$$first"; \
|
||||
fi; \
|
||||
fi; \
|
||||
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
|
||||
done; \
|
||||
reldir="$$dir2"
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
SUBDIRS = libnetbsd $(am__append_1) src
|
||||
EXTRA_DIST = \
|
||||
todo \
|
||||
tnftp.h
|
||||
|
||||
all: tnftp_config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
tnftp_config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/tnftp_config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status tnftp_config.h
|
||||
$(srcdir)/tnftp_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f tnftp_config.h stamp-h1
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) tnftp_config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) tnftp_config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) tnftp_config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) tnftp_config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
|
||||
$(am__relativize); \
|
||||
new_distdir=$$reldir; \
|
||||
dir1=$$subdir; dir2="$(top_distdir)"; \
|
||||
$(am__relativize); \
|
||||
new_top_distdir=$$reldir; \
|
||||
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
|
||||
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
|
||||
($(am__cd) $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$new_top_distdir" \
|
||||
distdir="$$new_distdir" \
|
||||
am__remove_distdir=: \
|
||||
am__skip_length_check=: \
|
||||
am__skip_mode_fix=: \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
-test -n "$(am__skip_mode_fix)" \
|
||||
|| find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r "$(distdir)"
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-lzma: distdir
|
||||
tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-xz: distdir
|
||||
tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.lzma*) \
|
||||
unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
|
||||
*.tar.xz*) \
|
||||
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
test -d $(distdir)/_build || exit 0; \
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& am__cwd=`pwd` \
|
||||
&& $(am__cd) $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
|
||||
&& cd "$$am__cwd" \
|
||||
|| exit 1
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
|
||||
distuninstallcheck:
|
||||
@$(am__cd) '$(distuninstallcheck_dir)' \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile tnftp_config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
|
||||
ctags-recursive install-am install-strip tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am am--refresh check check-am clean clean-generic \
|
||||
clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
|
||||
dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
|
||||
distcheck distclean distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distcleancheck distdir \
|
||||
distuninstallcheck dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
|
||||
ps ps-am tags tags-recursive uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
36
contrib/tnftp/NEWS
Normal file
36
contrib/tnftp/NEWS
Normal file
@ -0,0 +1,36 @@
|
||||
This is tnftp version 20091122.
|
||||
|
||||
Changes in tnftp from 20090606 to 20091122:
|
||||
|
||||
Portability fixes.
|
||||
|
||||
Changes in tnftp from 20090520 to 20090606:
|
||||
|
||||
Portability fixes.
|
||||
|
||||
Changes in tnftp from 20070806 to 20090520:
|
||||
|
||||
Fix intermittent "Alarm clock" error.
|
||||
|
||||
Add epsv6 and epsv to disable extended passive mode for IPv6 or
|
||||
both IPv4 and IPv6 respectively.
|
||||
|
||||
Improve parsing of HTTP chunked transfers per RFC2616.
|
||||
|
||||
Use the service name to getaddrinfo() (along with the host name),
|
||||
so that features such as DNS Service Discovery will work.
|
||||
|
||||
Fix various compiler warnings.
|
||||
|
||||
|
||||
Changes in tnftp from 20050625 to 20070806:
|
||||
|
||||
Implement '-s srcaddr' to set the local IP address for
|
||||
all connections.
|
||||
|
||||
Support '-q quittime' when waiting for server replies.
|
||||
|
||||
Use IEC 60027-2 "KiB", "MiB" (etc) instead of "KB", "MB", ...
|
||||
|
||||
Portability fixes, including for FreeBSD, Mac OS X, and Solaris.
|
||||
|
68
contrib/tnftp/README
Normal file
68
contrib/tnftp/README
Normal file
@ -0,0 +1,68 @@
|
||||
WHAT IS TNFTP?
|
||||
--------------
|
||||
|
||||
`tnftp' is a `port' of the NetBSD FTP client to other systems.
|
||||
See http://www.NetBSD.org/ for more details about NetBSD.
|
||||
|
||||
tnftp was formerly known as `lukemftp'
|
||||
It was renamed to `tnftp' by Luke Mewburn in February 2003.
|
||||
|
||||
The enhancements over the standard ftp client in 4.4BSD (and
|
||||
derivatives) include:
|
||||
* command-line editing within ftp
|
||||
* command-line fetching of URLS, including support for:
|
||||
- http proxies (see $http_proxy, $ftp_proxy)
|
||||
- authentication
|
||||
* configurable prompt
|
||||
* context sensitive command and filename completion
|
||||
* dynamic progress bar
|
||||
* feature negotiation extensions from RFC 2389
|
||||
(see `feat' and `remopts')
|
||||
* extensions to ftp from the IETF ftpext working group
|
||||
(see `mlsd' and `mlst')
|
||||
* IPv6 support (from the WIDE project)
|
||||
* modification time preservation
|
||||
* paging of local and remote files, and of directory listings
|
||||
(see `lpage', `page', `pdir')
|
||||
* passive mode support, with fallback to active mode
|
||||
* retrieval of filenames listed in a given file (see `fget')
|
||||
* `set option' override of ftp environment variables
|
||||
* TIS Firewall Toolkit gate ftp proxy support (see `gate')
|
||||
* transfer-rate throttling (see `-T', `rate')
|
||||
* uploading of files on the command line (see `-u')
|
||||
* (Dante) SOCKS5 support
|
||||
|
||||
Previous features, currently disabled until a test system is available:
|
||||
* SOCKS4 support
|
||||
|
||||
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
Refer to `INSTALL' for more information on how to compile and install tnftp.
|
||||
|
||||
|
||||
FEEDBACK / BUG REPORTS
|
||||
----------------------
|
||||
|
||||
Please email feedback back to the maintainer:
|
||||
Luke Mewburn <lukem@NetBSD.org>.
|
||||
|
||||
|
||||
COPYRIGHT
|
||||
---------
|
||||
|
||||
tnftp is covered by a BSD-style copyright notice.
|
||||
Please refer to the file `COPYING' for more information.
|
||||
|
||||
|
||||
AVAILABILITY
|
||||
------------
|
||||
|
||||
The primary ftp site for tnftp is:
|
||||
ftp://ftp.NetBSD.org/pub/NetBSD/misc/tnftp/
|
||||
|
||||
|
||||
DOCUMENT REFERENCE
|
||||
------------------
|
||||
$NetBSD: README,v 1.10 2007/08/06 01:58:57 lukem Exp $
|
53
contrib/tnftp/THANKS
Normal file
53
contrib/tnftp/THANKS
Normal file
@ -0,0 +1,53 @@
|
||||
Whilst a lot of the work in tnftp (both the original sources in NetBSD
|
||||
and this port) was done by Luke Mewburn, it would not be as usable
|
||||
without the enhancements, bug fixes, or input from the following people:
|
||||
|
||||
Amitai Schlair <schmonz@schmonz.com>
|
||||
Anders Dinsen <anders@dinsen.net>
|
||||
Anders Magnusson <ragge@ltu.se>
|
||||
Arkadiusz Miskiewicz <misiek@pld.org.pl>
|
||||
Brian Stark <bstark1990@netscape.net>
|
||||
Chris G. Demetriou <cgd@NetBSD.org>
|
||||
Christos Zoulas <christos@NetBSD.org>
|
||||
Dan Winship <danw@mit.edu>
|
||||
Darren Reed <darrenr@pobox.com>
|
||||
David Brownlee <abs@mono.org>
|
||||
David Carrel <carrel@NetBSD.org>
|
||||
DervishD <raul@pleyades.net>
|
||||
Douwe Kiela <virtus@wanadoo.nl>
|
||||
Eugene Kotlyarov <ekot@protek36.esoo.ru>
|
||||
Geoff Wing <mason@primenet.com.au>
|
||||
Giles Lean <giles@nemeton.com.au>
|
||||
Havard Eidnes <Havard.Eidnes@runit.sintef.no>
|
||||
Hubert Feyrer <hubert@feyrer.de>
|
||||
ITOH Yasufumi <itohy@NetBSD.org>
|
||||
Jason R. Thorpe <thorpej@NetBSD.org>
|
||||
John Hawkinson <jhawk@mit.edu>
|
||||
Joseph S. Myers <jsm28@cam.ac.uk>
|
||||
Jun-ichiro itojun Hagino <itojun@NetBSD.org>
|
||||
Kimmo Suominen <kim@tac.nyc.ny.us>
|
||||
Klaus Klein <kleink@NetBSD.org>
|
||||
Launey Thomas <ljt@alum.mit.edu>
|
||||
Luke Mewburn <lukem@NetBSD.org>
|
||||
Marc Horowitz <marc@mit.edu>
|
||||
Mathieu Arnold <mat@FreeBSD.org>
|
||||
Matthew R. Green <mrg@eterna.com.au>
|
||||
Matthias Pfaller <leo@dachau.marco.de>
|
||||
Matthias Scheler <tron@zhadum.de>
|
||||
Maxim Konovalov <maxim@FreeBSD.org>
|
||||
Maxime Henrion <mux@FreeBSD.org>
|
||||
Michael L. Hitch <osymh@terra.oscs.montana.edu>
|
||||
Mike Heffner <mikeh@FreeBSD.org>
|
||||
Onno van der Linden <o.vd.linden@quicknet.nl>
|
||||
Ruslan Ermilov <ru@FreeBSD.org>
|
||||
Ryoji Kanai <rkanai@eeye.com>
|
||||
Scott Aaron Bamford <sab@ansic.net>
|
||||
Simon Burge <simonb@thistledown.com.au>
|
||||
Steve McClellan <steve.mcclellan@radisys.com>
|
||||
TAMURA Kent <kent@NetBSD.org>
|
||||
Stoned Elipot <seb@NetBSD.org>
|
||||
Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
YAMANO Yuji <yyamano@NetBSD.org>
|
||||
Yar Tikhiy <yar@FreeBSD.org>
|
||||
|
||||
Apologies to anyone missed.
|
52
contrib/tnftp/src/Makefile.am
Normal file
52
contrib/tnftp/src/Makefile.am
Normal file
@ -0,0 +1,52 @@
|
||||
## $NetBSD: Makefile.am,v 1.2 2010/01/04 06:24:20 lukem Exp $
|
||||
|
||||
bin_PROGRAMS = tnftp
|
||||
|
||||
tnftp_SOURCES = \
|
||||
cmds.c \
|
||||
cmdtab.c \
|
||||
complete.c \
|
||||
domacro.c \
|
||||
fetch.c \
|
||||
ftp.c \
|
||||
main.c \
|
||||
progressbar.c \
|
||||
ruserpass.c \
|
||||
util.c
|
||||
|
||||
tnftp_CPPFLAGS = \
|
||||
-DHAVE_TNFTPD_H=1 \
|
||||
-D_DEFAULT_CONFDIR=\"${sysconfdir}\" \
|
||||
-I$(srcdir) \
|
||||
-I$(top_srcdir)/libnetbsd \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_builddir)
|
||||
|
||||
tnftp_LDADD = \
|
||||
../libnetbsd/libnetbsd.la
|
||||
|
||||
|
||||
if USE_LIBEDIT
|
||||
tnftp_CPPFLAGS += \
|
||||
-I$(top_srcdir)/libedit
|
||||
|
||||
tnftp_LDADD += \
|
||||
../libedit/libedit.la
|
||||
endif
|
||||
|
||||
|
||||
man1_MANS = \
|
||||
tnftp.1
|
||||
|
||||
tnftp.1: ftp.1
|
||||
cp $(srcdir)/ftp.1 tnftp.1
|
||||
|
||||
CLEANFILES = \
|
||||
tnftp.1
|
||||
|
||||
EXTRA_DIST = \
|
||||
extern.h \
|
||||
ftp.1 \
|
||||
ftp_var.h \
|
||||
progressbar.h \
|
||||
version.h
|
809
contrib/tnftp/src/Makefile.in
Normal file
809
contrib/tnftp/src/Makefile.in
Normal file
@ -0,0 +1,809 @@
|
||||
# Makefile.in generated by automake 1.11 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
bin_PROGRAMS = tnftp$(EXEEXT)
|
||||
@USE_LIBEDIT_TRUE@am__append_1 = \
|
||||
@USE_LIBEDIT_TRUE@ -I$(top_srcdir)/libedit
|
||||
|
||||
@USE_LIBEDIT_TRUE@am__append_2 = \
|
||||
@USE_LIBEDIT_TRUE@ ../libedit/libedit.la
|
||||
|
||||
subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/tnftp_config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_tnftp_OBJECTS = tnftp-cmds.$(OBJEXT) tnftp-cmdtab.$(OBJEXT) \
|
||||
tnftp-complete.$(OBJEXT) tnftp-domacro.$(OBJEXT) \
|
||||
tnftp-fetch.$(OBJEXT) tnftp-ftp.$(OBJEXT) tnftp-main.$(OBJEXT) \
|
||||
tnftp-progressbar.$(OBJEXT) tnftp-ruserpass.$(OBJEXT) \
|
||||
tnftp-util.$(OBJEXT)
|
||||
tnftp_OBJECTS = $(am_tnftp_OBJECTS)
|
||||
tnftp_DEPENDENCIES = ../libnetbsd/libnetbsd.la $(am__append_2)
|
||||
AM_V_lt = $(am__v_lt_$(V))
|
||||
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_lt_0 = --silent
|
||||
DEFAULT_INCLUDES =
|
||||
depcomp = $(SHELL) $(top_srcdir)/buildaux/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CFLAGS) $(CFLAGS)
|
||||
AM_V_CC = $(am__v_CC_$(V))
|
||||
am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CC_0 = @echo " CC " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CCLD = $(am__v_CCLD_$(V))
|
||||
am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CCLD_0 = @echo " CCLD " $@;
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
SOURCES = $(tnftp_SOURCES)
|
||||
DIST_SOURCES = $(tnftp_SOURCES)
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
man1dir = $(mandir)/man1
|
||||
NROFF = nroff
|
||||
MANS = $(man1_MANS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
AMTAR = @AMTAR@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
tnftp_SOURCES = \
|
||||
cmds.c \
|
||||
cmdtab.c \
|
||||
complete.c \
|
||||
domacro.c \
|
||||
fetch.c \
|
||||
ftp.c \
|
||||
main.c \
|
||||
progressbar.c \
|
||||
ruserpass.c \
|
||||
util.c
|
||||
|
||||
tnftp_CPPFLAGS = -DHAVE_TNFTPD_H=1 \
|
||||
-D_DEFAULT_CONFDIR=\"${sysconfdir}\" -I$(srcdir) \
|
||||
-I$(top_srcdir)/libnetbsd -I$(top_srcdir) -I$(top_builddir) \
|
||||
$(am__append_1)
|
||||
tnftp_LDADD = ../libnetbsd/libnetbsd.la $(am__append_2)
|
||||
man1_MANS = \
|
||||
tnftp.1
|
||||
|
||||
CLEANFILES = \
|
||||
tnftp.1
|
||||
|
||||
EXTRA_DIST = \
|
||||
extern.h \
|
||||
ftp.1 \
|
||||
ftp_var.h \
|
||||
progressbar.h \
|
||||
version.h
|
||||
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed 's/$(EXEEXT)$$//' | \
|
||||
while read p p1; do if test -f $$p || test -f $$p1; \
|
||||
then echo "$$p"; echo "$$p"; else :; fi; \
|
||||
done | \
|
||||
sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
|
||||
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
|
||||
sed 'N;N;N;s,\n, ,g' | \
|
||||
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
|
||||
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
|
||||
if ($$2 == $$4) files[d] = files[d] " " $$1; \
|
||||
else { print "f", $$3 "/" $$4, $$1; } } \
|
||||
END { for (d in files) print "f", d, files[d] }' | \
|
||||
while read type dir files; do \
|
||||
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
|
||||
} \
|
||||
; done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
|
||||
files=`for p in $$list; do echo "$$p"; done | \
|
||||
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
|
||||
-e 's/$$/$(EXEEXT)/' `; \
|
||||
test -n "$$list" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(bindir)" && rm -f $$files
|
||||
|
||||
clean-binPROGRAMS:
|
||||
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list || exit $$?; \
|
||||
test -n "$(EXEEXT)" || exit 0; \
|
||||
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
|
||||
echo " rm -f" $$list; \
|
||||
rm -f $$list
|
||||
tnftp$(EXEEXT): $(tnftp_OBJECTS) $(tnftp_DEPENDENCIES)
|
||||
@rm -f tnftp$(EXEEXT)
|
||||
$(AM_V_CCLD)$(LINK) $(tnftp_OBJECTS) $(tnftp_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-cmds.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-cmdtab.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-complete.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-domacro.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-fetch.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-ftp.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-main.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-progressbar.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-ruserpass.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnftp-util.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
tnftp-cmds.o: cmds.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmds.o -MD -MP -MF $(DEPDIR)/tnftp-cmds.Tpo -c -o tnftp-cmds.o `test -f 'cmds.c' || echo '$(srcdir)/'`cmds.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmds.Tpo $(DEPDIR)/tnftp-cmds.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmds.c' object='tnftp-cmds.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmds.o `test -f 'cmds.c' || echo '$(srcdir)/'`cmds.c
|
||||
|
||||
tnftp-cmds.obj: cmds.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmds.obj -MD -MP -MF $(DEPDIR)/tnftp-cmds.Tpo -c -o tnftp-cmds.obj `if test -f 'cmds.c'; then $(CYGPATH_W) 'cmds.c'; else $(CYGPATH_W) '$(srcdir)/cmds.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmds.Tpo $(DEPDIR)/tnftp-cmds.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmds.c' object='tnftp-cmds.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmds.obj `if test -f 'cmds.c'; then $(CYGPATH_W) 'cmds.c'; else $(CYGPATH_W) '$(srcdir)/cmds.c'; fi`
|
||||
|
||||
tnftp-cmdtab.o: cmdtab.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmdtab.o -MD -MP -MF $(DEPDIR)/tnftp-cmdtab.Tpo -c -o tnftp-cmdtab.o `test -f 'cmdtab.c' || echo '$(srcdir)/'`cmdtab.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmdtab.Tpo $(DEPDIR)/tnftp-cmdtab.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmdtab.c' object='tnftp-cmdtab.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmdtab.o `test -f 'cmdtab.c' || echo '$(srcdir)/'`cmdtab.c
|
||||
|
||||
tnftp-cmdtab.obj: cmdtab.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-cmdtab.obj -MD -MP -MF $(DEPDIR)/tnftp-cmdtab.Tpo -c -o tnftp-cmdtab.obj `if test -f 'cmdtab.c'; then $(CYGPATH_W) 'cmdtab.c'; else $(CYGPATH_W) '$(srcdir)/cmdtab.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-cmdtab.Tpo $(DEPDIR)/tnftp-cmdtab.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cmdtab.c' object='tnftp-cmdtab.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-cmdtab.obj `if test -f 'cmdtab.c'; then $(CYGPATH_W) 'cmdtab.c'; else $(CYGPATH_W) '$(srcdir)/cmdtab.c'; fi`
|
||||
|
||||
tnftp-complete.o: complete.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-complete.o -MD -MP -MF $(DEPDIR)/tnftp-complete.Tpo -c -o tnftp-complete.o `test -f 'complete.c' || echo '$(srcdir)/'`complete.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-complete.Tpo $(DEPDIR)/tnftp-complete.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='complete.c' object='tnftp-complete.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-complete.o `test -f 'complete.c' || echo '$(srcdir)/'`complete.c
|
||||
|
||||
tnftp-complete.obj: complete.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-complete.obj -MD -MP -MF $(DEPDIR)/tnftp-complete.Tpo -c -o tnftp-complete.obj `if test -f 'complete.c'; then $(CYGPATH_W) 'complete.c'; else $(CYGPATH_W) '$(srcdir)/complete.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-complete.Tpo $(DEPDIR)/tnftp-complete.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='complete.c' object='tnftp-complete.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-complete.obj `if test -f 'complete.c'; then $(CYGPATH_W) 'complete.c'; else $(CYGPATH_W) '$(srcdir)/complete.c'; fi`
|
||||
|
||||
tnftp-domacro.o: domacro.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-domacro.o -MD -MP -MF $(DEPDIR)/tnftp-domacro.Tpo -c -o tnftp-domacro.o `test -f 'domacro.c' || echo '$(srcdir)/'`domacro.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-domacro.Tpo $(DEPDIR)/tnftp-domacro.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='domacro.c' object='tnftp-domacro.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-domacro.o `test -f 'domacro.c' || echo '$(srcdir)/'`domacro.c
|
||||
|
||||
tnftp-domacro.obj: domacro.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-domacro.obj -MD -MP -MF $(DEPDIR)/tnftp-domacro.Tpo -c -o tnftp-domacro.obj `if test -f 'domacro.c'; then $(CYGPATH_W) 'domacro.c'; else $(CYGPATH_W) '$(srcdir)/domacro.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-domacro.Tpo $(DEPDIR)/tnftp-domacro.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='domacro.c' object='tnftp-domacro.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-domacro.obj `if test -f 'domacro.c'; then $(CYGPATH_W) 'domacro.c'; else $(CYGPATH_W) '$(srcdir)/domacro.c'; fi`
|
||||
|
||||
tnftp-fetch.o: fetch.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-fetch.o -MD -MP -MF $(DEPDIR)/tnftp-fetch.Tpo -c -o tnftp-fetch.o `test -f 'fetch.c' || echo '$(srcdir)/'`fetch.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-fetch.Tpo $(DEPDIR)/tnftp-fetch.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetch.c' object='tnftp-fetch.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-fetch.o `test -f 'fetch.c' || echo '$(srcdir)/'`fetch.c
|
||||
|
||||
tnftp-fetch.obj: fetch.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-fetch.obj -MD -MP -MF $(DEPDIR)/tnftp-fetch.Tpo -c -o tnftp-fetch.obj `if test -f 'fetch.c'; then $(CYGPATH_W) 'fetch.c'; else $(CYGPATH_W) '$(srcdir)/fetch.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-fetch.Tpo $(DEPDIR)/tnftp-fetch.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fetch.c' object='tnftp-fetch.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-fetch.obj `if test -f 'fetch.c'; then $(CYGPATH_W) 'fetch.c'; else $(CYGPATH_W) '$(srcdir)/fetch.c'; fi`
|
||||
|
||||
tnftp-ftp.o: ftp.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ftp.o -MD -MP -MF $(DEPDIR)/tnftp-ftp.Tpo -c -o tnftp-ftp.o `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ftp.Tpo $(DEPDIR)/tnftp-ftp.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ftp.c' object='tnftp-ftp.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ftp.o `test -f 'ftp.c' || echo '$(srcdir)/'`ftp.c
|
||||
|
||||
tnftp-ftp.obj: ftp.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ftp.obj -MD -MP -MF $(DEPDIR)/tnftp-ftp.Tpo -c -o tnftp-ftp.obj `if test -f 'ftp.c'; then $(CYGPATH_W) 'ftp.c'; else $(CYGPATH_W) '$(srcdir)/ftp.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ftp.Tpo $(DEPDIR)/tnftp-ftp.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ftp.c' object='tnftp-ftp.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ftp.obj `if test -f 'ftp.c'; then $(CYGPATH_W) 'ftp.c'; else $(CYGPATH_W) '$(srcdir)/ftp.c'; fi`
|
||||
|
||||
tnftp-main.o: main.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-main.o -MD -MP -MF $(DEPDIR)/tnftp-main.Tpo -c -o tnftp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-main.Tpo $(DEPDIR)/tnftp-main.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='tnftp-main.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c
|
||||
|
||||
tnftp-main.obj: main.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-main.obj -MD -MP -MF $(DEPDIR)/tnftp-main.Tpo -c -o tnftp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-main.Tpo $(DEPDIR)/tnftp-main.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='main.c' object='tnftp-main.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi`
|
||||
|
||||
tnftp-progressbar.o: progressbar.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-progressbar.o -MD -MP -MF $(DEPDIR)/tnftp-progressbar.Tpo -c -o tnftp-progressbar.o `test -f 'progressbar.c' || echo '$(srcdir)/'`progressbar.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-progressbar.Tpo $(DEPDIR)/tnftp-progressbar.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='progressbar.c' object='tnftp-progressbar.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-progressbar.o `test -f 'progressbar.c' || echo '$(srcdir)/'`progressbar.c
|
||||
|
||||
tnftp-progressbar.obj: progressbar.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-progressbar.obj -MD -MP -MF $(DEPDIR)/tnftp-progressbar.Tpo -c -o tnftp-progressbar.obj `if test -f 'progressbar.c'; then $(CYGPATH_W) 'progressbar.c'; else $(CYGPATH_W) '$(srcdir)/progressbar.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-progressbar.Tpo $(DEPDIR)/tnftp-progressbar.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='progressbar.c' object='tnftp-progressbar.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-progressbar.obj `if test -f 'progressbar.c'; then $(CYGPATH_W) 'progressbar.c'; else $(CYGPATH_W) '$(srcdir)/progressbar.c'; fi`
|
||||
|
||||
tnftp-ruserpass.o: ruserpass.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ruserpass.o -MD -MP -MF $(DEPDIR)/tnftp-ruserpass.Tpo -c -o tnftp-ruserpass.o `test -f 'ruserpass.c' || echo '$(srcdir)/'`ruserpass.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ruserpass.Tpo $(DEPDIR)/tnftp-ruserpass.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ruserpass.c' object='tnftp-ruserpass.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ruserpass.o `test -f 'ruserpass.c' || echo '$(srcdir)/'`ruserpass.c
|
||||
|
||||
tnftp-ruserpass.obj: ruserpass.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-ruserpass.obj -MD -MP -MF $(DEPDIR)/tnftp-ruserpass.Tpo -c -o tnftp-ruserpass.obj `if test -f 'ruserpass.c'; then $(CYGPATH_W) 'ruserpass.c'; else $(CYGPATH_W) '$(srcdir)/ruserpass.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-ruserpass.Tpo $(DEPDIR)/tnftp-ruserpass.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ruserpass.c' object='tnftp-ruserpass.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-ruserpass.obj `if test -f 'ruserpass.c'; then $(CYGPATH_W) 'ruserpass.c'; else $(CYGPATH_W) '$(srcdir)/ruserpass.c'; fi`
|
||||
|
||||
tnftp-util.o: util.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-util.o -MD -MP -MF $(DEPDIR)/tnftp-util.Tpo -c -o tnftp-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-util.Tpo $(DEPDIR)/tnftp-util.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='tnftp-util.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
|
||||
|
||||
tnftp-util.obj: util.c
|
||||
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tnftp-util.obj -MD -MP -MF $(DEPDIR)/tnftp-util.Tpo -c -o tnftp-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
|
||||
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/tnftp-util.Tpo $(DEPDIR)/tnftp-util.Po
|
||||
@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='tnftp-util.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(tnftp_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tnftp-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
install-man1: $(man1_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
|
||||
@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
|
||||
{ for i in $$list; do echo "$$i"; done; \
|
||||
} | while read p; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; echo "$$p"; \
|
||||
done | \
|
||||
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
|
||||
sed 'N;N;s,\n, ,g' | { \
|
||||
list=; while read file base inst; do \
|
||||
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
|
||||
fi; \
|
||||
done; \
|
||||
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
test -z "$$files" || { \
|
||||
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
|
||||
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
|
||||
done; }
|
||||
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \
|
||||
files=`{ for i in $$list; do echo "$$i"; done; \
|
||||
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
|
||||
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
|
||||
test -z "$$files" || { \
|
||||
echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@list='$(MANS)'; if test -n "$$list"; then \
|
||||
list=`for p in $$list; do \
|
||||
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
|
||||
if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
|
||||
if test -n "$$list" && \
|
||||
grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
|
||||
echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
|
||||
grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
|
||||
echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
|
||||
echo " typically \`make maintainer-clean' will remove them" >&2; \
|
||||
exit 1; \
|
||||
else :; fi; \
|
||||
else :; fi
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(PROGRAMS) $(MANS)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man: install-man1
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-man
|
||||
|
||||
uninstall-man: uninstall-man1
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-binPROGRAMS install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-man1 install-pdf install-pdf-am install-ps \
|
||||
install-ps-am install-strip installcheck installcheck-am \
|
||||
installdirs maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-binPROGRAMS uninstall-man \
|
||||
uninstall-man1
|
||||
|
||||
|
||||
tnftp.1: ftp.1
|
||||
cp $(srcdir)/ftp.1 tnftp.1
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: cmdtab.c,v 1.44 2005/04/11 01:49:31 lukem Exp $ */
|
||||
/* $NetBSD: cmdtab.c,v 1.11 2009/05/20 12:53:47 lukem Exp $ */
|
||||
/* from NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -65,16 +59,23 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tnftp.h"
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#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.44 2005/04/11 01:49:31 lukem Exp $");
|
||||
__RCSID(" NetBSD: cmdtab.c,v 1.51 2009/04/12 10:18:52 lukem Exp ");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#endif /* tnftp */
|
||||
|
||||
#include "ftp_var.h"
|
||||
|
||||
/*
|
||||
@ -100,7 +101,9 @@ HSTR deletehelp[] = "delete remote file";
|
||||
HSTR disconhelp[] = "terminate ftp session";
|
||||
HSTR domachelp[] = "execute macro";
|
||||
HSTR edithelp[] = "toggle command line editing";
|
||||
HSTR epsvhelp[] = "toggle use of EPSV/EPRT on both IPv4 and IPV6 ftp";
|
||||
HSTR epsv4help[] = "toggle use of EPSV/EPRT on IPv4 ftp";
|
||||
HSTR epsv6help[] = "toggle use of EPSV/EPRT on IPv6 ftp";
|
||||
HSTR feathelp[] = "show FEATures supported by remote system";
|
||||
HSTR formhelp[] = "set file transfer format";
|
||||
HSTR gatehelp[] = "toggle gate-ftp; specify host[:port] to change proxy";
|
||||
@ -211,7 +214,9 @@ struct cmd cmdtab[] = {
|
||||
{ "dir", H(lshelp), 1, 1, 1, CMPL(rl) ls },
|
||||
{ "disconnect", H(disconhelp), 0, 1, 1, CMPL0 disconnect },
|
||||
{ "edit", H(edithelp), 0, 0, 0, CMPL0 setedit },
|
||||
{ "epsv", H(epsvhelp), 0, 0, 0, CMPL0 setepsv },
|
||||
{ "epsv4", H(epsv4help), 0, 0, 0, CMPL0 setepsv4 },
|
||||
{ "epsv6", H(epsv6help), 0, 0, 0, CMPL0 setepsv6 },
|
||||
{ "exit", H(quithelp), 0, 0, 0, CMPL0 quit },
|
||||
{ "features", H(feathelp), 0, 1, 1, CMPL0 feat },
|
||||
{ "fget", H(fgethelp), 1, 1, 1, CMPL(l) fget },
|
||||
@ -294,7 +299,7 @@ struct cmd cmdtab[] = {
|
||||
{ "verbose", H(verbosehelp), 0, 0, 0, CMPL0 setverbose },
|
||||
{ "xferbuf", H(xferbufhelp), 0, 0, 0, CMPL0 setxferbuf },
|
||||
{ "?", H(helphelp), 0, 0, 1, CMPL(C) help },
|
||||
{ 0 },
|
||||
{ NULL, NULL, 0, 0, 0, CMPL0 NULL },
|
||||
};
|
||||
|
||||
struct option optiontab[] = {
|
||||
@ -305,5 +310,5 @@ struct option optiontab[] = {
|
||||
{ "pager", NULL },
|
||||
{ "prompt", NULL },
|
||||
{ "rprompt", NULL },
|
||||
{ 0 },
|
||||
{ NULL, NULL },
|
||||
};
|
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $ */
|
||||
/* $NetBSD: complete.c,v 1.10 2009/05/20 12:53:47 lukem Exp $ */
|
||||
/* from NetBSD: complete.c,v 1.46 2009/04/12 10:18:52 lukem Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -36,9 +30,13 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tnftp.h"
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $");
|
||||
__RCSID(" NetBSD: complete.c,v 1.46 2009/04/12 10:18:52 lukem Exp ");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -54,6 +52,8 @@ __RCSID("$NetBSD: complete.c,v 1.38 2000/05/01 10:35:17 lukem Exp $");
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#endif /* tnftp */
|
||||
|
||||
#include "ftp_var.h"
|
||||
|
||||
#ifndef NO_EDITCOMPLETE
|
||||
@ -68,7 +68,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));
|
||||
}
|
||||
|
||||
/*
|
||||
@ -87,7 +87,7 @@ complete_ambiguous(char *word, int list, StringList *words)
|
||||
{
|
||||
char insertstr[MAXPATHLEN];
|
||||
char *lastmatch, *p;
|
||||
int i, j;
|
||||
size_t i, j;
|
||||
size_t matchlen, wordlen;
|
||||
|
||||
wordlen = strlen(word);
|
||||
@ -143,14 +143,14 @@ complete_command(char *word, int list)
|
||||
size_t wordlen;
|
||||
unsigned char rv;
|
||||
|
||||
words = xsl_init();
|
||||
words = ftp_sl_init();
|
||||
wordlen = strlen(word);
|
||||
|
||||
for (c = cmdtab; c->c_name != NULL; c++) {
|
||||
if (wordlen > strlen(c->c_name))
|
||||
continue;
|
||||
if (strncmp(word, c->c_name, wordlen) == 0)
|
||||
xsl_add(words, c->c_name);
|
||||
ftp_sl_add(words, ftp_strdup(c->c_name));
|
||||
}
|
||||
|
||||
rv = complete_ambiguous(word, list, words);
|
||||
@ -158,7 +158,7 @@ complete_command(char *word, int list)
|
||||
if (el_insertstr(el, " ") == -1)
|
||||
rv = CC_ERROR;
|
||||
}
|
||||
sl_free(words, 0);
|
||||
sl_free(words, 1);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ complete_local(char *word, int list)
|
||||
if ((dd = opendir(dir)) == NULL)
|
||||
return (CC_ERROR);
|
||||
|
||||
words = xsl_init();
|
||||
words = ftp_sl_init();
|
||||
len = strlen(file);
|
||||
|
||||
for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
|
||||
@ -217,8 +217,8 @@ complete_local(char *word, int list)
|
||||
if (strncmp(file, dp->d_name, len) == 0) {
|
||||
char *tcp;
|
||||
|
||||
tcp = xstrdup(dp->d_name);
|
||||
xsl_add(words, tcp);
|
||||
tcp = ftp_strdup(dp->d_name);
|
||||
ftp_sl_add(words, tcp);
|
||||
}
|
||||
}
|
||||
closedir(dd);
|
||||
@ -255,14 +255,14 @@ complete_option(char *word, int list)
|
||||
size_t wordlen;
|
||||
unsigned char rv;
|
||||
|
||||
words = xsl_init();
|
||||
words = ftp_sl_init();
|
||||
wordlen = strlen(word);
|
||||
|
||||
for (o = optiontab; o->name != NULL; o++) {
|
||||
if (wordlen > strlen(o->name))
|
||||
continue;
|
||||
if (strncmp(word, o->name, wordlen) == 0)
|
||||
xsl_add(words, o->name);
|
||||
ftp_sl_add(words, ftp_strdup(o->name));
|
||||
}
|
||||
|
||||
rv = complete_ambiguous(word, list, words);
|
||||
@ -270,7 +270,7 @@ complete_option(char *word, int list)
|
||||
if (el_insertstr(el, " ") == -1)
|
||||
rv = CC_ERROR;
|
||||
}
|
||||
sl_free(words, 0);
|
||||
sl_free(words, 1);
|
||||
return (rv);
|
||||
}
|
||||
|
||||
@ -285,10 +285,13 @@ complete_remote(char *word, int list)
|
||||
StringList *words;
|
||||
char dir[MAXPATHLEN];
|
||||
char *file, *cp;
|
||||
int i;
|
||||
size_t i;
|
||||
unsigned char rv;
|
||||
char cmdbuf[MAX_C_NAME];
|
||||
char *dummyargv[3] = { NULL, NULL, NULL };
|
||||
|
||||
char *dummyargv[] = { "complete", NULL, NULL };
|
||||
(void)strlcpy(cmdbuf, "complete", sizeof(cmdbuf));
|
||||
dummyargv[0] = cmdbuf;
|
||||
dummyargv[1] = dir;
|
||||
|
||||
if ((file = strrchr(word, '/')) == NULL) {
|
||||
@ -304,11 +307,11 @@ 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);
|
||||
dirlist = xsl_init();
|
||||
dirlist = ftp_sl_init();
|
||||
|
||||
mflag = 1;
|
||||
emesg = NULL;
|
||||
@ -326,8 +329,8 @@ complete_remote(char *word, int list)
|
||||
tcp++;
|
||||
else
|
||||
tcp = cp;
|
||||
tcp = xstrdup(tcp);
|
||||
xsl_add(dirlist, tcp);
|
||||
tcp = ftp_strdup(tcp);
|
||||
ftp_sl_add(dirlist, tcp);
|
||||
}
|
||||
if (emesg != NULL) {
|
||||
fprintf(ttyout, "\n%s\n", emesg);
|
||||
@ -337,13 +340,13 @@ complete_remote(char *word, int list)
|
||||
dirchange = 0;
|
||||
}
|
||||
|
||||
words = xsl_init();
|
||||
words = ftp_sl_init();
|
||||
for (i = 0; i < dirlist->sl_cur; i++) {
|
||||
cp = dirlist->sl_str[i];
|
||||
if (strlen(file) > strlen(cp))
|
||||
continue;
|
||||
if (strncmp(file, cp, strlen(file)) == 0)
|
||||
xsl_add(words, cp);
|
||||
ftp_sl_add(words, cp);
|
||||
}
|
||||
rv = complete_ambiguous(file, list, words);
|
||||
sl_free(words, 0);
|
||||
@ -354,17 +357,17 @@ complete_remote(char *word, int list)
|
||||
* Generic complete routine
|
||||
*/
|
||||
unsigned char
|
||||
complete(EditLine *el, int ch)
|
||||
complete(EditLine *cel, int ch)
|
||||
{
|
||||
static char word[FTPBUFLEN];
|
||||
static int lastc_argc, lastc_argo;
|
||||
static size_t lastc_argc, lastc_argo;
|
||||
|
||||
struct cmd *c;
|
||||
const LineInfo *lf;
|
||||
int celems, dolist, cmpltype;
|
||||
size_t len;
|
||||
int dolist, cmpltype;
|
||||
size_t celems, len;
|
||||
|
||||
lf = el_line(el);
|
||||
lf = el_line(cel);
|
||||
len = lf->lastchar - lf->buffer;
|
||||
if (len >= sizeof(line))
|
||||
return (CC_ERROR);
|
||||
@ -383,7 +386,7 @@ complete(EditLine *el, int ch)
|
||||
&& strncmp(word, margv[cursor_argc] ? margv[cursor_argc] : "",
|
||||
cursor_argo) == 0)
|
||||
dolist = 1;
|
||||
else if (cursor_argc < margc)
|
||||
else if (cursor_argc < (size_t)margc)
|
||||
(void)strlcpy(word, margv[cursor_argc], cursor_argo + 1);
|
||||
word[cursor_argo] = '\0';
|
||||
|
||||
@ -426,7 +429,8 @@ complete(EditLine *el, int ch)
|
||||
}
|
||||
return (complete_remote(word, dolist));
|
||||
default:
|
||||
errx(1, "unknown complete type `%c'", cmpltype);
|
||||
errx(1, "complete: unknown complete type `%c'",
|
||||
cmpltype);
|
||||
return (CC_ERROR);
|
||||
}
|
||||
/* NOTREACHED */
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp $ */
|
||||
/* $NetBSD: domacro.c,v 1.8 2009/05/20 12:53:47 lukem Exp $ */
|
||||
/* from NetBSD: domacro.c,v 1.22 2009/04/12 10:18:52 lukem Exp */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, 1993, 1994
|
||||
@ -29,12 +30,16 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tnftp.h"
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#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.20 2003/08/07 11:13:53 agc Exp $");
|
||||
__RCSID(" NetBSD: domacro.c,v 1.22 2009/04/12 10:18:52 lukem Exp ");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -42,6 +47,8 @@ __RCSID("$NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp $");
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#endif /* tnftp */
|
||||
|
||||
#include "ftp_var.h"
|
||||
|
||||
void
|
||||
@ -50,10 +57,11 @@ domacro(int argc, char *argv[])
|
||||
int i, j, count = 2, loopflg = 0;
|
||||
char *cp1, *cp2, line2[FTPBUFLEN];
|
||||
struct cmd *c;
|
||||
char cmdbuf[MAX_C_NAME];
|
||||
|
||||
if ((argc == 0 && argv != NULL) ||
|
||||
(argc < 2 && !another(&argc, &argv, "macro name"))) {
|
||||
fprintf(ttyout, "usage: %s macro_name [args]\n", argv[0]);
|
||||
UPRINTF("usage: %s macro_name [args]\n", argv[0]);
|
||||
code = -1;
|
||||
return;
|
||||
}
|
||||
@ -126,7 +134,8 @@ domacro(int argc, char *argv[])
|
||||
fputs(line, ttyout);
|
||||
putc('\n', ttyout);
|
||||
}
|
||||
margv[0] = c->c_name;
|
||||
(void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
|
||||
margv[0] = cmdbuf;
|
||||
(*c->c_handler)(margc, margv);
|
||||
if (bell && c->c_bell)
|
||||
(void)putc('\007', ttyout);
|
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: extern.h,v 1.67 2005/05/14 15:26:43 lukem Exp $ */
|
||||
/* $NetBSD: extern.h,v 1.12 2009/11/15 10:12:37 lukem Exp $ */
|
||||
/* from NetBSD: extern.h,v 1.77 2009/07/13 19:05:41 roy Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -118,7 +112,7 @@ void cmdabort(int);
|
||||
void cmdtimeout(int);
|
||||
void cmdscanner(void);
|
||||
int command(const char *, ...)
|
||||
__attribute__((__format__(__printf__, 1, 2)));
|
||||
;
|
||||
#ifndef NO_EDITCOMPLETE
|
||||
unsigned char complete(EditLine *, int);
|
||||
void controlediting(void);
|
||||
@ -141,6 +135,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 get_line(FILE *, char *, size_t, const char **);
|
||||
struct option *getoption(const char *);
|
||||
char *getoptionvalue(const char *);
|
||||
void getremoteinfo(void);
|
||||
@ -148,7 +143,7 @@ int getreply(int);
|
||||
char *globulize(const char *);
|
||||
char *gunique(const char *);
|
||||
void help(int, char **);
|
||||
char *hookup(char *, char *);
|
||||
char *hookup(const char *, const char *);
|
||||
void idlecmd(int, char **);
|
||||
int initconn(void);
|
||||
void intr(int);
|
||||
@ -159,22 +154,19 @@ void lostpeer(int);
|
||||
void lpage(int, char **);
|
||||
void lpwd(int, char **);
|
||||
void ls(int, char **);
|
||||
void mabort(void);
|
||||
void macdef(int, char **);
|
||||
void makeargv(void);
|
||||
void makedir(int, char **);
|
||||
void mdelete(int, char **);
|
||||
void mget(int, char **);
|
||||
void mintr(int);
|
||||
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 **);
|
||||
int parseport(const char *, int);
|
||||
int parserate(int, char **, int);
|
||||
char *prompt(void);
|
||||
void proxabort(int);
|
||||
@ -189,18 +181,18 @@ 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 **);
|
||||
void renamefile(int, char **);
|
||||
void reset(int, char **);
|
||||
void restart(int, char **);
|
||||
const char *rfc2822time(const struct tm *);
|
||||
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 **);
|
||||
@ -210,6 +202,8 @@ void setcr(int, char **);
|
||||
void setdebug(int, char **);
|
||||
void setedit(int, char **);
|
||||
void setepsv4(int, char **);
|
||||
void setepsv6(int, char **);
|
||||
void setepsv(int, char **);
|
||||
void setform(int, char **);
|
||||
void setftmode(int, char **);
|
||||
void setgate(int, char **);
|
||||
@ -235,6 +229,7 @@ void settype(int, char **);
|
||||
void setupsockbufsize(int);
|
||||
void setverbose(int, char **);
|
||||
void setxferbuf(int, char **);
|
||||
void set_option(const char *, const char *, int);
|
||||
void shell(int, char **);
|
||||
void site(int, char **);
|
||||
void sizecmd(int, char **);
|
||||
@ -248,10 +243,10 @@ void updatelocalcwd(void);
|
||||
void updateremotecwd(void);
|
||||
void usage(void);
|
||||
void user(int, char **);
|
||||
int xconnect(int, const struct sockaddr *, socklen_t);
|
||||
int xlisten(int, int);
|
||||
int xpoll(struct pollfd *, int, int);
|
||||
void *xmalloc(size_t);
|
||||
StringList *xsl_init(void);
|
||||
void xsl_add(StringList *, char *);
|
||||
char *xstrdup(const char *);
|
||||
int ftp_connect(int, const struct sockaddr *, socklen_t);
|
||||
int ftp_listen(int, int);
|
||||
int ftp_poll(struct pollfd *, int, int);
|
||||
void *ftp_malloc(size_t);
|
||||
StringList *ftp_sl_init(void);
|
||||
void ftp_sl_add(StringList *, char *);
|
||||
char *ftp_strdup(const char *);
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
||||
.\" $NetBSD: ftp.1,v 1.109 2005/02/20 20:54:01 wiz Exp $
|
||||
.\" $NetBSD: ftp.1,v 1.13 2009/11/15 10:12:37 lukem Exp $
|
||||
.\" from NetBSD: ftp.1,v 1.130 2009/07/11 18:35:48 joerg Exp
|
||||
.\"
|
||||
.\" Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
|
||||
.\" Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -14,13 +15,6 @@
|
||||
.\" 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
|
||||
@ -64,16 +58,15 @@
|
||||
.\"
|
||||
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
|
||||
.\"
|
||||
.Dd January 15, 2005
|
||||
.Dd May 10, 2008
|
||||
.Dt FTP 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ftp
|
||||
.Nd
|
||||
Internet file transfer program
|
||||
.Nd Internet file transfer program
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl 46AadefginpRtvV
|
||||
.Op Fl 46AadefginpRtVv
|
||||
.Bk -words
|
||||
.Op Fl N Ar netrc
|
||||
.Ek
|
||||
@ -89,6 +82,7 @@ Internet file transfer program
|
||||
.Bk -words
|
||||
.Op Fl r Ar retry
|
||||
.Ek
|
||||
.Op Fl s Ar srcaddr
|
||||
.Bk -words
|
||||
.\" [-T dir,max[,inc]]
|
||||
.Oo
|
||||
@ -179,7 +173,7 @@ below for more information.
|
||||
.Pp
|
||||
Options may be specified at the command line, or to the
|
||||
command interpreter.
|
||||
.Bl -tag -width "port "
|
||||
.Bl -tag -width Fl
|
||||
.It Fl 4
|
||||
Forces
|
||||
.Nm
|
||||
@ -219,6 +213,14 @@ Disables file name globbing.
|
||||
.It Fl i
|
||||
Turns off interactive prompting during
|
||||
multiple file transfers.
|
||||
.It Fl N Ar netrc
|
||||
Use
|
||||
.Ar netrc
|
||||
instead of
|
||||
.Pa ~/.netrc .
|
||||
Refer to
|
||||
.Sx THE .netrc FILE
|
||||
for more information.
|
||||
.It Fl n
|
||||
Restrains
|
||||
.Nm
|
||||
@ -238,14 +240,6 @@ identity on the local machine), and, if necessary, prompt for a password
|
||||
and an account with which to login.
|
||||
To override the auto-login for auto-fetch transfers, specify the
|
||||
username (and optionally, password) as appropriate.
|
||||
.It Fl N Ar netrc
|
||||
Use
|
||||
.Ar netrc
|
||||
instead of
|
||||
.Pa ~/.netrc .
|
||||
Refer to
|
||||
.Sx THE .netrc FILE
|
||||
for more information.
|
||||
.It Fl o Ar output
|
||||
When auto-fetching files, save the contents in
|
||||
.Ar output .
|
||||
@ -263,35 +257,32 @@ then only the first file specified will be retrieved into
|
||||
.Ar output ;
|
||||
all other files will be retrieved into the basename of their
|
||||
remote name.
|
||||
.It Fl P Ar port
|
||||
Sets the port number to
|
||||
.Ar port .
|
||||
.It Fl p
|
||||
Enable passive mode operation for use behind connection filtering firewalls.
|
||||
This option has been deprecated as
|
||||
.Nm
|
||||
now tries to use passive mode by default, falling back to active mode
|
||||
if the server does not support passive connections.
|
||||
.It Fl P Ar port
|
||||
Sets the port number to
|
||||
.Ar port .
|
||||
.It Fl r Ar wait
|
||||
Retry the connection attempt if it failed, pausing for
|
||||
.Ar wait
|
||||
seconds.
|
||||
.It Fl q Ar quittime
|
||||
Quit if the connection has stalled for
|
||||
.Ar quittime
|
||||
seconds.
|
||||
.It Fl R
|
||||
Restart all non-proxied auto-fetches.
|
||||
.It Fl r Ar wait
|
||||
Retry the connection attempt if it failed, pausing for
|
||||
.Ar wait
|
||||
seconds.
|
||||
.It Fl s Ar srcaddr
|
||||
Uses
|
||||
.Ar srcaddr
|
||||
as the local IP address for all connections.
|
||||
.It Fl t
|
||||
Enables packet tracing.
|
||||
.It Xo
|
||||
.Fl T
|
||||
.Sm off
|
||||
.Ar direction ,
|
||||
.Ar maximum
|
||||
.Op , Ar increment
|
||||
.Sm on
|
||||
.Xc
|
||||
.It Fl T Ar direction Ns , Ns Ar maximum Ns Oo , Ns Ar increment Oc
|
||||
Set the maximum transfer rate for
|
||||
.Ar direction
|
||||
to
|
||||
@ -312,6 +303,12 @@ is one of the ftp URL types as supported by auto-fetch
|
||||
(with an optional target filename for single file uploads), and
|
||||
.Ar file
|
||||
is one or more local files to be uploaded.
|
||||
.It Fl V
|
||||
Disable
|
||||
.Ic verbose
|
||||
and
|
||||
.Ic progress ,
|
||||
overriding the default of enabled when output is to a terminal.
|
||||
.It Fl v
|
||||
Enable
|
||||
.Ic verbose
|
||||
@ -325,12 +322,6 @@ Forces
|
||||
.Nm
|
||||
to show all responses from the remote server, as well
|
||||
as report on data transfer statistics.
|
||||
.It Fl V
|
||||
Disable
|
||||
.Ic verbose
|
||||
and
|
||||
.Ic progress ,
|
||||
overriding the default of enabled when output is to a terminal.
|
||||
.El
|
||||
.Pp
|
||||
The client host with which
|
||||
@ -351,8 +342,8 @@ is awaiting commands from the user the prompt
|
||||
is provided to the user.
|
||||
The following commands are recognized
|
||||
by
|
||||
.Nm ftp :
|
||||
.Bl -tag -width Fl
|
||||
.Nm ftp :
|
||||
.Bl -tag -width Ic
|
||||
.It Ic \&! Op Ar command Op Ar args
|
||||
Invoke an interactive shell on the local machine.
|
||||
If there are arguments, the first is taken to be a command to execute
|
||||
@ -455,16 +446,6 @@ when an ascii type transfer is made, these linefeeds may be
|
||||
distinguished from a record delimiter only when
|
||||
.Ic \&cr
|
||||
is off.
|
||||
.It Ic debug Op Ar debug-value
|
||||
Toggle debugging mode.
|
||||
If an optional
|
||||
.Ar debug-value
|
||||
is specified it is used to set the debugging level.
|
||||
When debugging is on,
|
||||
.Nm
|
||||
prints each command sent to the remote machine, preceded
|
||||
by the string
|
||||
.Ql \-\-\*[Gt]
|
||||
.It Ic delete Ar remote-file
|
||||
Delete the file
|
||||
.Ar remote-file
|
||||
@ -500,12 +481,13 @@ Toggle command line editing, and context sensitive command and file
|
||||
completion.
|
||||
This is automatically enabled if input is from a terminal, and
|
||||
disabled otherwise.
|
||||
.It Ic epsv4
|
||||
.It Ic epsv epsv4 epsv6
|
||||
Toggle the use of the extended
|
||||
.Dv EPSV
|
||||
and
|
||||
.Dv EPRT
|
||||
commands on IPv4 connections; first try
|
||||
commands on all IP, IPv4, and IPv6 connections respectively.
|
||||
First try
|
||||
.Dv EPSV /
|
||||
.Dv EPRT ,
|
||||
and then
|
||||
@ -514,7 +496,10 @@ and then
|
||||
This is enabled by default.
|
||||
If an extended command fails then this option will be temporarily
|
||||
disabled for the duration of the current connection, or until
|
||||
.Ic epsv4
|
||||
.Ic epsv ,
|
||||
.Ic epsv4 ,
|
||||
or
|
||||
.Ic epsv6
|
||||
is executed again.
|
||||
.It Ic exit
|
||||
A synonym for
|
||||
@ -538,6 +523,16 @@ format is
|
||||
.It Ic ftp Ar host Op Ar port
|
||||
A synonym for
|
||||
.Ic open .
|
||||
.It Ic ftp_debug Op Ar ftp_debug-value
|
||||
Toggle debugging mode.
|
||||
If an optional
|
||||
.Ar ftp_debug-value
|
||||
is specified it is used to set the debugging level.
|
||||
When debugging is on,
|
||||
.Nm
|
||||
prints each command sent to the remote machine, preceded
|
||||
by the string
|
||||
.Ql \-\-\*[Gt] .
|
||||
.It Ic gate Op Ar host Op Ar port
|
||||
Toggle gate-ftp mode, which used to connect through the
|
||||
TIS FWTK and Gauntlet ftp proxies.
|
||||
@ -613,8 +608,9 @@ transferring a
|
||||
.Xr tar 1
|
||||
archive of the subtree (in binary mode).
|
||||
.It Ic hash Op Ar size
|
||||
Toggle hash-sign (``#'') printing for each data block
|
||||
transferred.
|
||||
Toggle hash-sign
|
||||
.Pq Sq #
|
||||
printing for each data block transferred.
|
||||
The size of a data block defaults to 1024 bytes.
|
||||
This can be changed by specifying
|
||||
.Ar size
|
||||
@ -663,24 +659,49 @@ A synonym for
|
||||
Define a macro.
|
||||
Subsequent lines are stored as the macro
|
||||
.Ar macro-name ;
|
||||
a null line (consecutive newline characters
|
||||
in a file or
|
||||
carriage returns from the terminal) terminates macro input mode.
|
||||
a null line (consecutive newline characters in a file or carriage
|
||||
returns from the terminal) terminates macro input mode.
|
||||
There is a limit of 16 macros and 4096 total characters in all
|
||||
defined macros.
|
||||
Macros remain defined until a
|
||||
Macro names can be a maximum of 8 characters.
|
||||
Macros are only applicable to the current session they are
|
||||
defined within (or if defined outside a session, to the session
|
||||
invoked with the next
|
||||
.Ic open
|
||||
command), and remain defined until a
|
||||
.Ic close
|
||||
command is executed.
|
||||
The macro processor interprets `$' and `\e' as special characters.
|
||||
A `$' followed by a number (or numbers) is replaced by the
|
||||
To invoke a macro, use the
|
||||
.Ic $
|
||||
command (see above).
|
||||
.Pp
|
||||
The macro processor interprets
|
||||
.Sq $
|
||||
and
|
||||
.Sq \e
|
||||
as special characters.
|
||||
A
|
||||
.Sq $
|
||||
followed by a number (or numbers) is replaced by the
|
||||
corresponding argument on the macro invocation command line.
|
||||
A `$' followed by an `i' signals that macro processor that the
|
||||
executing macro is to be looped.
|
||||
On the first pass `$i' is
|
||||
replaced by the first argument on the macro invocation command line,
|
||||
on the second pass it is replaced by the second argument, and so on.
|
||||
A `\e' followed by any character is replaced by that character.
|
||||
Use the `\e' to prevent special treatment of the `$'.
|
||||
A
|
||||
.Sq $
|
||||
followed by an
|
||||
.Sq i
|
||||
signals the macro processor that the executing macro is to be
|
||||
looped.
|
||||
On the first pass
|
||||
.Dq $i
|
||||
is replaced by the first argument on the macro invocation command
|
||||
line, on the second pass it is replaced by the second argument,
|
||||
and so on.
|
||||
A
|
||||
.Sq \e
|
||||
followed by any character is replaced by that character.
|
||||
Use the
|
||||
.Sq \e
|
||||
to prevent special treatment of the
|
||||
.Sq $ .
|
||||
.It Ic mdelete Op Ar remote-files
|
||||
Delete the
|
||||
.Ar remote-files
|
||||
@ -756,7 +777,9 @@ The default (and only supported)
|
||||
mode is
|
||||
.Dq stream .
|
||||
.It Ic modtime Ar remote-file
|
||||
Show the last modification time of the file on the remote machine.
|
||||
Show the last modification time of the file on the remote machine, in
|
||||
.Li RFC2822
|
||||
format.
|
||||
.It Ic more Ar file
|
||||
A synonym for
|
||||
.Ic page .
|
||||
@ -823,9 +846,18 @@ and
|
||||
.Ic case
|
||||
settings).
|
||||
Variable templating is accomplished by including the
|
||||
sequences `$1', `$2', ..., `$9' in
|
||||
sequences
|
||||
.Dq $1 ,
|
||||
.Dq $2 ,
|
||||
\&...
|
||||
.Dq $9
|
||||
in
|
||||
.Ar inpattern .
|
||||
Use `\\' to prevent this special treatment of the `$' character.
|
||||
Use
|
||||
.Sq \e
|
||||
to prevent this special treatment of the
|
||||
.Sq $
|
||||
character.
|
||||
All other characters are treated literally, and are used to determine the
|
||||
.Ic nmap
|
||||
.Op Ar inpattern
|
||||
@ -837,13 +869,19 @@ $1.$2 and the remote file name "mydata.data", $1 would have the value
|
||||
The
|
||||
.Ar outpattern
|
||||
determines the resulting mapped filename.
|
||||
The sequences `$1', `$2', ...., `$9' are replaced by any value resulting
|
||||
from the
|
||||
The sequences
|
||||
.Dq $1 ,
|
||||
.Dq $2 ,
|
||||
\&...
|
||||
.Dq $9
|
||||
are replaced by any value resulting from the
|
||||
.Ar inpattern
|
||||
template.
|
||||
The sequence `$0' is replace by the original filename.
|
||||
The sequence
|
||||
.Dq $0
|
||||
is replaced by the original filename.
|
||||
Additionally, the sequence
|
||||
.Ql Op Ar seq1 , Ar seq2
|
||||
.Dq Op Ar seq1 , Ar seq2
|
||||
is replaced by
|
||||
.Op Ar seq1
|
||||
if
|
||||
@ -862,9 +900,18 @@ the output filename "myfile.data" for input filenames "myfile.data" and
|
||||
"myfile.myfile" for the input filename ".myfile".
|
||||
Spaces may be included in
|
||||
.Ar outpattern ,
|
||||
as in the example: `nmap $1 sed "s/ *$//" \*[Gt] $1' .
|
||||
Use the `\e' character to prevent special treatment
|
||||
of the `$','[',']', and `,' characters.
|
||||
as in the example:
|
||||
.Dl nmap $1 sed "s/ *$//" \*[Gt] $1
|
||||
Use the
|
||||
.Sq \e
|
||||
character to prevent special treatment
|
||||
of the
|
||||
.Sq $ ,
|
||||
.Sq \&[ ,
|
||||
.Sq \&] ,
|
||||
and
|
||||
.Sq \&,
|
||||
characters.
|
||||
.It Ic ntrans Op Ar inchars Op Ar outchars
|
||||
Set or unset the filename character translation mechanism.
|
||||
If no arguments are specified, the filename character
|
||||
@ -952,7 +999,7 @@ traffic.
|
||||
servers are required to support the
|
||||
.Dv PASV
|
||||
command by
|
||||
.Li RFC 1123 ,
|
||||
.Li RFC1123 ,
|
||||
some do not.)
|
||||
.It Ic pdir Op Ar remote-path
|
||||
Perform
|
||||
@ -1100,10 +1147,7 @@ A synonym for
|
||||
The arguments specified are sent, verbatim, to the remote
|
||||
.Tn FTP
|
||||
server.
|
||||
.It Xo
|
||||
.Ic rate Ar direction
|
||||
.Op Ar maximum Op Ar increment
|
||||
.Xc
|
||||
.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
|
||||
Throttle the maximum transfer rate to
|
||||
.Ar maximum
|
||||
bytes/second.
|
||||
@ -1126,7 +1170,6 @@ Outgoing transfers.
|
||||
can be modified on the fly by
|
||||
.Ar increment
|
||||
bytes (default: 1024) each time a given signal is received:
|
||||
.B
|
||||
.Bl -tag -width "SIGUSR1" -offset indent
|
||||
.It Dv SIGUSR1
|
||||
Increment
|
||||
@ -1388,10 +1431,7 @@ for more information.
|
||||
.It Ic usage Ar command
|
||||
Print the usage message for
|
||||
.Ar command .
|
||||
.It Xo
|
||||
.Ic user Ar user-name
|
||||
.Op Ar password Op Ar account
|
||||
.Xc
|
||||
.It Ic user Ar user-name Oo Ar password Oo Ar account Oc Oc
|
||||
Identify yourself to the remote
|
||||
.Tn FTP
|
||||
server.
|
||||
@ -1439,7 +1479,9 @@ A synonym for
|
||||
.El
|
||||
.Pp
|
||||
Command arguments which have embedded spaces may be quoted with
|
||||
quote `"' marks.
|
||||
quote
|
||||
.Sq \&"
|
||||
marks.
|
||||
.Pp
|
||||
Commands which toggle settings can take an explicit
|
||||
.Ic on
|
||||
@ -1491,14 +1533,8 @@ on the command line.
|
||||
The following formats are valid syntax for an auto-fetch element:
|
||||
.Bl -tag -width "FOO "
|
||||
.\" [user@]host:[path][/]
|
||||
.It Xo
|
||||
.Sm off
|
||||
.Op Ar user Li \&@
|
||||
.Ar host Li \&:
|
||||
.Op Ar path
|
||||
.Op Li /
|
||||
.Sm on
|
||||
.Xc
|
||||
.It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \
|
||||
Ns Oo Li / Oc
|
||||
.Dq Classic
|
||||
.Tn FTP
|
||||
format.
|
||||
@ -1523,18 +1559,9 @@ in the current directory.
|
||||
Otherwise, the full remote name is used as the local name,
|
||||
relative to the local root directory.
|
||||
.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
|
||||
.It Xo
|
||||
.Sm off
|
||||
.Li ftp://
|
||||
.Oo Ar user
|
||||
.Op Li \&: Ar password
|
||||
.Li \&@ Oc
|
||||
.Ar host Oo Li \&: Ar port Oc
|
||||
.Li / Ar path
|
||||
.Op Li /
|
||||
.Op Li ;type= Ar X
|
||||
.Sm on
|
||||
.Xc
|
||||
.It Li ftp:// Ns Oo Ar user Ns Oo Ns Li \&: Ns Ar password Oc Ns Li \&@ Oc \
|
||||
Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path Ns Oo Li / Oc \
|
||||
Ns Oo Li ;type= Ns Ar X Oc
|
||||
An
|
||||
.Tn FTP
|
||||
URL, retrieved using the
|
||||
@ -1565,7 +1592,7 @@ ascii or binary (respectively).
|
||||
The default transfer type is binary.
|
||||
.Pp
|
||||
In order to be compliant with
|
||||
.Li RFC 1738 ,
|
||||
.Li RFC3986 ,
|
||||
.Nm
|
||||
interprets the
|
||||
.Ar path
|
||||
@ -1618,7 +1645,7 @@ Any
|
||||
.Sq Li \&% Ns Ar XX
|
||||
codes
|
||||
(per
|
||||
.Li RFC 1738 )
|
||||
.Li RFC3986 )
|
||||
within the path components are decoded, with
|
||||
.Ar XX
|
||||
representing a character code in hexadecimal.
|
||||
@ -1705,16 +1732,8 @@ intermediate directories that is used in the equivalent of a
|
||||
command.
|
||||
.El
|
||||
.\" http://[user[:password]@]host[:port]/path
|
||||
.It Xo
|
||||
.Sm off
|
||||
.Li http://
|
||||
.Oo Ar user
|
||||
.Op Li \&: Ar password
|
||||
.Li \&@ Oc
|
||||
.Ar host Oo Li \&: Ar port Oc
|
||||
.Li / Ar path
|
||||
.Sm on
|
||||
.Xc
|
||||
.It Li http:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
|
||||
Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
|
||||
An
|
||||
.Tn HTTP
|
||||
URL, retrieved using the
|
||||
@ -1735,14 +1754,25 @@ and
|
||||
.Sq password )
|
||||
is in the URL, use them for the first attempt to authenticate.
|
||||
.\" file:///path
|
||||
.It Xo
|
||||
.Sm off
|
||||
.Li file:/// Ar path
|
||||
.Sm on
|
||||
.Xc
|
||||
.It Li file:/// Ns Ar path
|
||||
A local URL, copied from
|
||||
.Pa / Ns Ar path
|
||||
on the local host.
|
||||
.\" about:
|
||||
.It Li about: Ns Ar topic
|
||||
Display information regarding
|
||||
.Ar topic ;
|
||||
no file is retrieved for this auto-fetched element.
|
||||
Supported values include:
|
||||
.Bl -tag -width "about:version"
|
||||
.It Li about:ftp
|
||||
Information about
|
||||
.Nm ftp .
|
||||
.It Li about:version
|
||||
The version of
|
||||
.Nm ftp .
|
||||
Useful to provide when reporting problems.
|
||||
.El
|
||||
.El
|
||||
.Pp
|
||||
Unless noted otherwise above, and
|
||||
@ -1868,11 +1898,12 @@ A particularly
|
||||
useful example of this mechanism is:
|
||||
.Dq Li dir \&"\&" \&|more .
|
||||
.It
|
||||
Failing the above checks, if ``globbing'' is enabled,
|
||||
local file names are expanded
|
||||
according to the rules used in the
|
||||
Failing the above checks, if
|
||||
.Dq globbing
|
||||
is enabled, local file names are expanded according to the rules
|
||||
used in the
|
||||
.Xr csh 1 ;
|
||||
c.f. the
|
||||
see the
|
||||
.Ic glob
|
||||
command.
|
||||
If the
|
||||
@ -2038,6 +2069,20 @@ next
|
||||
.Pa .netrc
|
||||
line and continue until a blank line (consecutive new-line
|
||||
characters) is encountered.
|
||||
Like the other tokens in the
|
||||
.Pa .netrc
|
||||
file, a
|
||||
.Ic macdef
|
||||
is applicable only to the
|
||||
.Ic machine
|
||||
definition preceding it.
|
||||
A
|
||||
.Ic macdef
|
||||
entry cannot be used by multiple
|
||||
.Ic machine
|
||||
definitions; rather, it must be defined following each
|
||||
.Ic machine
|
||||
it is intended to be used with.
|
||||
If a macro named
|
||||
.Ic init
|
||||
is defined, it is automatically executed as the last step in the
|
||||
@ -2100,14 +2145,7 @@ information:
|
||||
.It Li \&%/
|
||||
The current remote working directory.
|
||||
.\" %c[[0]n], %.[[0]n]
|
||||
.It Xo
|
||||
.Sm off
|
||||
.Li \&%c
|
||||
.Op Oo Li 0 Oc Ar n Ns ,
|
||||
.Li \&%.
|
||||
.Op Oo Li 0 Oc Ar n
|
||||
.Sm on
|
||||
.Xc
|
||||
.It \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Ns Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc
|
||||
The trailing component of the current remote working directory, or
|
||||
.Em n
|
||||
trailing components if a digit
|
||||
@ -2248,7 +2286,7 @@ URL characters are required in the username or password
|
||||
or
|
||||
.Sq / ) ,
|
||||
encode them with
|
||||
.Li RFC 1738
|
||||
.Li RFC3986
|
||||
.Sq Li \&% Ns Ar XX
|
||||
encoding.
|
||||
.Pp
|
||||
@ -2291,16 +2329,27 @@ for an example of how to make this automatic.
|
||||
.Xr ftpd 8
|
||||
.Sh STANDARDS
|
||||
.Nm
|
||||
attempts to be compliant with
|
||||
.Li RFC 959 ,
|
||||
.Li RFC 1123 ,
|
||||
.Li RFC 1738 ,
|
||||
.Li RFC 2068 ,
|
||||
.Li RFC 2389 ,
|
||||
.Li RFC 2428 ,
|
||||
.Li RFC 2732 ,
|
||||
and
|
||||
.Cm draft-ietf-ftpext-mlst-11 .
|
||||
attempts to be compliant with:
|
||||
.Bl -tag -offset indent -width 8n
|
||||
.It Li RFC0959
|
||||
.Em File Transfer Protocol
|
||||
.It Li RFC1123
|
||||
.Em Requirements for Internet Hosts - Application and Support
|
||||
.It Li RFC1635
|
||||
.Em How to Use Anonymous FTP
|
||||
.It Li RFC2389
|
||||
.Em Feature negotiation mechanism for the File Transfer Protocol
|
||||
.It Li RFC2428
|
||||
.Em FTP Extensions for IPv6 and NATs
|
||||
.It Li RFC2616
|
||||
.Em Hypertext Transfer Protocol -- HTTP/1.1
|
||||
.It Li RFC2822
|
||||
.Em Internet Message Format
|
||||
.It Li RFC3659
|
||||
.Em Extensions to FTP
|
||||
.It Li RFC3986
|
||||
.Em Uniform Resource Identifier (URI)
|
||||
.El
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: ftp_var.h,v 1.71 2005/04/11 01:49:31 lukem Exp $ */
|
||||
/* $NetBSD: ftp_var.h,v 1.10 2009/05/20 12:53:47 lukem Exp $ */
|
||||
/* from NetBSD: ftp_var.h,v 1.81 2009/04/12 10:18:52 lukem Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2005 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -107,6 +101,8 @@
|
||||
#define NO_PROGRESS
|
||||
#endif
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
@ -117,6 +113,8 @@
|
||||
#include <setjmp.h>
|
||||
#include <stringlist.h>
|
||||
|
||||
#endif /* tnftp */
|
||||
|
||||
#ifndef NO_EDITCOMPLETE
|
||||
#include <histedit.h>
|
||||
#endif /* !NO_EDITCOMPLETE */
|
||||
@ -128,7 +126,7 @@
|
||||
* Format of command table.
|
||||
*/
|
||||
struct cmd {
|
||||
char *c_name; /* name of command */
|
||||
const char *c_name; /* name of command */
|
||||
const char *c_help; /* help string */
|
||||
char c_bell; /* give bell when command completes */
|
||||
char c_conn; /* must be connected to use command */
|
||||
@ -139,6 +137,8 @@ struct cmd {
|
||||
void (*c_handler)(int, char **); /* function to call */
|
||||
};
|
||||
|
||||
#define MAX_C_NAME 12 /* maximum length of cmd.c_name */
|
||||
|
||||
/*
|
||||
* Format of macro table
|
||||
*/
|
||||
@ -152,8 +152,8 @@ struct macel {
|
||||
* Format of option table
|
||||
*/
|
||||
struct option {
|
||||
char *name;
|
||||
char *value;
|
||||
const char *name;
|
||||
char *value;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -210,14 +210,14 @@ GLOBAL int sendport; /* use PORT/LPRT cmd for each data connection */
|
||||
GLOBAL int connected; /* 1 = connected to server, -1 = logged in */
|
||||
GLOBAL int interactive; /* interactively prompt on m* cmds */
|
||||
GLOBAL int confirmrest; /* confirm rest of current m* cmd */
|
||||
GLOBAL int debug; /* debugging level */
|
||||
GLOBAL int ftp_debug; /* debugging level */
|
||||
GLOBAL int bell; /* ring bell on cmd completion */
|
||||
GLOBAL int doglob; /* glob local file names */
|
||||
GLOBAL int autologin; /* establish user account on connection */
|
||||
GLOBAL int proxy; /* proxy server connection active */
|
||||
GLOBAL int proxflag; /* proxy connection exists */
|
||||
GLOBAL int gatemode; /* use gate-ftp */
|
||||
GLOBAL char *gateserver; /* server to use for gate-ftp */
|
||||
GLOBAL const char *gateserver; /* server to use for gate-ftp */
|
||||
GLOBAL int sunique; /* store files on server with unique name */
|
||||
GLOBAL int runique; /* store local files with unique name */
|
||||
GLOBAL int mcase; /* map upper to lower case for mget names */
|
||||
@ -252,9 +252,11 @@ GLOBAL int rate_get_incr; /* increment for get xfer rate */
|
||||
GLOBAL int rate_put; /* maximum put xfer rate */
|
||||
GLOBAL int rate_put_incr; /* increment for put xfer rate */
|
||||
GLOBAL int retry_connect; /* seconds between retrying connection */
|
||||
GLOBAL char *tmpdir; /* temporary directory */
|
||||
GLOBAL const char *tmpdir; /* temporary directory */
|
||||
GLOBAL int epsv4; /* use EPSV/EPRT on IPv4 connections */
|
||||
GLOBAL int epsv4bad; /* EPSV doesn't work on the current server */
|
||||
GLOBAL int epsv6; /* use EPSV/EPRT on IPv6 connections */
|
||||
GLOBAL int epsv6bad; /* EPSV doesn't work on the current server */
|
||||
GLOBAL int editing; /* command line editing enabled */
|
||||
GLOBAL int features[FEAT_max]; /* remote FEATures supported */
|
||||
|
||||
@ -266,8 +268,6 @@ GLOBAL size_t cursor_argc; /* location of cursor in margv */
|
||||
GLOBAL size_t cursor_argo; /* offset of cursor in margv[cursor_argc] */
|
||||
#endif /* !NO_EDITCOMPLETE */
|
||||
|
||||
GLOBAL char *direction; /* direction transfer is occurring */
|
||||
|
||||
GLOBAL char *hostname; /* name of host connected to */
|
||||
GLOBAL int unix_server; /* server is unix, can use binary for ascii */
|
||||
GLOBAL int unix_proxy; /* proxy is unix, can use binary for ascii */
|
||||
@ -276,9 +276,10 @@ GLOBAL char remotecwd[MAXPATHLEN]; /* remote dir */
|
||||
GLOBAL char *username; /* name of user logged in as. (dynamic) */
|
||||
|
||||
GLOBAL sa_family_t family; /* address family to use for connections */
|
||||
GLOBAL char *ftpport; /* port number to use for FTP connections */
|
||||
GLOBAL char *httpport; /* port number to use for HTTP connections */
|
||||
GLOBAL char *gateport; /* port number to use for gateftp connections */
|
||||
GLOBAL const char *ftpport; /* port number to use for FTP connections */
|
||||
GLOBAL const char *httpport; /* port number to use for HTTP connections */
|
||||
GLOBAL const char *gateport; /* port number to use for gateftp connections */
|
||||
GLOBAL struct addrinfo *bindai; /* local address to bind as */
|
||||
|
||||
GLOBAL char *outfile; /* filename to output URLs to */
|
||||
GLOBAL int restartautofetch; /* restart auto-fetch */
|
||||
@ -327,7 +328,7 @@ extern struct option optiontab[];
|
||||
#define FREEPTR(x) if ((x) != NULL) { free(x); (x) = NULL; }
|
||||
|
||||
#ifdef BSD4_4
|
||||
# define HAVE_SOCKADDR_SA_LEN 1
|
||||
# define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
|
||||
#endif
|
||||
|
||||
#ifdef NO_LONG_LONG
|
||||
@ -335,3 +336,20 @@ extern struct option optiontab[];
|
||||
#else
|
||||
# define STRTOLL(x,y,z) strtoll(x,y,z)
|
||||
#endif
|
||||
|
||||
#ifdef NO_DEBUG
|
||||
#define DPRINTF(...)
|
||||
#define DWARN(...)
|
||||
#else
|
||||
#define DPRINTF(...) if (ftp_debug) (void)fprintf(ttyout, __VA_ARGS__)
|
||||
#define DWARN(...) if (ftp_debug) warn(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#define STRorNULL(s) ((s) ? (s) : "<null>")
|
||||
|
||||
#ifdef NO_USAGE
|
||||
void xusage(void);
|
||||
#define UPRINTF(...) xusage()
|
||||
#else
|
||||
#define UPRINTF(...) (void)fprintf(ttyout, __VA_ARGS__)
|
||||
#endif
|
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $ */
|
||||
/* $NetBSD: main.c,v 1.17 2009/11/15 10:12:37 lukem Exp $ */
|
||||
/* from NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -94,17 +88,22 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tnftp.h"
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#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");
|
||||
__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\
|
||||
The Regents of the University of California. All rights reserved.\
|
||||
Copyright 1996-2008 The NetBSD Foundation, Inc. All rights reserved");
|
||||
#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.94 2005/05/13 05:03:49 lukem Exp $");
|
||||
__RCSID(" NetBSD: main.c,v 1.117 2009/07/13 19:05:41 roy Exp ");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -123,9 +122,12 @@ __RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <locale.h>
|
||||
|
||||
#endif /* tnftp */
|
||||
|
||||
#define GLOBAL /* force GLOBAL decls in ftp_var.h to be declared */
|
||||
#include "ftp_var.h"
|
||||
|
||||
@ -134,19 +136,24 @@ __RCSID("$NetBSD: main.c,v 1.94 2005/05/13 05:03:49 lukem Exp $");
|
||||
#define NO_PROXY "no_proxy" /* env var with list of non-proxied
|
||||
* hosts, comma or space separated */
|
||||
|
||||
static void setupoption(char *, char *, char *);
|
||||
static void setupoption(const char *, const char *, const char *);
|
||||
int main(int, char *[]);
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
main(int volatile argc, char **volatile argv)
|
||||
{
|
||||
int ch, rval;
|
||||
struct passwd *pw;
|
||||
char *cp, *ep, *anonuser, *anonpass, *upload_path;
|
||||
int dumbterm, s, len, isupload;
|
||||
char *cp, *ep, *anonpass, *upload_path, *src_addr;
|
||||
const char *anonuser;
|
||||
int dumbterm, s, isupload;
|
||||
size_t len;
|
||||
socklen_t slen;
|
||||
|
||||
tzset();
|
||||
#if 0 /* tnftp */ /* XXX */
|
||||
setlocale(LC_ALL, "");
|
||||
#endif /* tnftp */
|
||||
setprogname(argv[0]);
|
||||
|
||||
sigint_raised = 0;
|
||||
@ -184,14 +191,22 @@ main(int argc, char *argv[])
|
||||
rate_put_incr = DEFAULTINCR;
|
||||
#ifdef INET6
|
||||
epsv4 = 1;
|
||||
epsv6 = 1;
|
||||
#else
|
||||
epsv4 = 0;
|
||||
epsv6 = 0;
|
||||
#endif
|
||||
epsv4bad = 0;
|
||||
epsv6bad = 0;
|
||||
src_addr = NULL;
|
||||
upload_path = NULL;
|
||||
isupload = 0;
|
||||
reply_callback = NULL;
|
||||
#ifdef INET6
|
||||
family = AF_UNSPEC;
|
||||
#else
|
||||
family = AF_INET; /* force AF_INET if no INET6 support */
|
||||
#endif
|
||||
|
||||
netrc[0] = '\0';
|
||||
cp = getenv("NETRC");
|
||||
@ -206,15 +221,15 @@ main(int argc, char *argv[])
|
||||
*/
|
||||
s = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if (s == -1)
|
||||
err(1, "can't create socket");
|
||||
err(1, "Can't create socket to determine default socket sizes");
|
||||
slen = sizeof(rcvbuf_size);
|
||||
if (getsockopt(s, SOL_SOCKET, SO_RCVBUF,
|
||||
(void *)&rcvbuf_size, &slen) == -1)
|
||||
err(1, "unable to get default rcvbuf size");
|
||||
err(1, "Unable to get default rcvbuf size");
|
||||
slen = sizeof(sndbuf_size);
|
||||
if (getsockopt(s, SOL_SOCKET, SO_SNDBUF,
|
||||
(void *)&sndbuf_size, &slen) == -1)
|
||||
err(1, "unable to get default sndbuf size");
|
||||
err(1, "Unable to get default sndbuf size");
|
||||
(void)close(s);
|
||||
/* sanity check returned buffer sizes */
|
||||
if (rcvbuf_size <= 0)
|
||||
@ -227,7 +242,7 @@ main(int argc, char *argv[])
|
||||
if (rcvbuf_size > 8 * 1024 * 1024)
|
||||
rcvbuf_size = 8 * 1024 * 1024;
|
||||
|
||||
marg_sl = xsl_init();
|
||||
marg_sl = ftp_sl_init();
|
||||
if ((tmpdir = getenv("TMPDIR")) == NULL)
|
||||
tmpdir = _PATH_TMP;
|
||||
|
||||
@ -245,7 +260,7 @@ main(int argc, char *argv[])
|
||||
passivemode = 1;
|
||||
activefallback = 1;
|
||||
} else
|
||||
warnx("unknown $FTPMODE '%s'; using defaults", cp);
|
||||
warnx("Unknown $FTPMODE `%s'; using defaults", cp);
|
||||
}
|
||||
|
||||
if (strcmp(getprogname(), "pftp") == 0) {
|
||||
@ -286,7 +301,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:RtT:u:vV")) != -1) {
|
||||
while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vV")) != -1) {
|
||||
switch (ch) {
|
||||
case '4':
|
||||
family = AF_INET;
|
||||
@ -311,7 +326,7 @@ main(int argc, char *argv[])
|
||||
|
||||
case 'd':
|
||||
options |= SO_DEBUG;
|
||||
debug++;
|
||||
ftp_debug++;
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
@ -361,19 +376,23 @@ main(int argc, char *argv[])
|
||||
case 'q':
|
||||
quit_time = strtol(optarg, &ep, 10);
|
||||
if (quit_time < 1 || *ep != '\0')
|
||||
errx(1, "bad quit value: %s", optarg);
|
||||
errx(1, "Bad quit value: %s", optarg);
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
retry_connect = strtol(optarg, &ep, 10);
|
||||
if (retry_connect < 1 || *ep != '\0')
|
||||
errx(1, "bad retry value: %s", optarg);
|
||||
errx(1, "Bad retry value: %s", optarg);
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
restartautofetch = 1;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
src_addr = optarg;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
trace = 1;
|
||||
break;
|
||||
@ -382,15 +401,18 @@ main(int argc, char *argv[])
|
||||
{
|
||||
int targc;
|
||||
char *targv[6], *oac;
|
||||
char cmdbuf[MAX_C_NAME];
|
||||
|
||||
/* look for `dir,max[,incr]' */
|
||||
targc = 0;
|
||||
targv[targc++] = "-T";
|
||||
oac = xstrdup(optarg);
|
||||
(void)strlcpy(cmdbuf, "-T", sizeof(cmdbuf));
|
||||
targv[targc++] = cmdbuf;
|
||||
oac = ftp_strdup(optarg);
|
||||
|
||||
while ((cp = strsep(&oac, ",")) != NULL) {
|
||||
if (*cp == '\0') {
|
||||
warnx("bad throttle value: %s", optarg);
|
||||
warnx("Bad throttle value `%s'",
|
||||
optarg);
|
||||
usage();
|
||||
/* NOTREACHED */
|
||||
}
|
||||
@ -408,7 +430,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
isupload = 1;
|
||||
interactive = 0;
|
||||
upload_path = xstrdup(optarg);
|
||||
upload_path = ftp_strdup(optarg);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -435,6 +457,22 @@ main(int argc, char *argv[])
|
||||
crflag = 1; /* strip c.r. on ascii gets */
|
||||
sendport = -1; /* not using ports */
|
||||
|
||||
if (src_addr != NULL) {
|
||||
struct addrinfo hints;
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = family;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_flags = AI_PASSIVE;
|
||||
error = getaddrinfo(src_addr, NULL, &hints, &bindai);
|
||||
if (error) {
|
||||
errx(1, "Can't lookup `%s': %s", src_addr,
|
||||
(error == EAI_SYSTEM) ? strerror(errno)
|
||||
: gai_strerror(error));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cache the user name and home directory.
|
||||
*/
|
||||
@ -443,7 +481,7 @@ main(int argc, char *argv[])
|
||||
anonuser = "anonymous";
|
||||
cp = getenv("HOME");
|
||||
if (! EMPTYSTRING(cp))
|
||||
localhome = xstrdup(cp);
|
||||
localhome = ftp_strdup(cp);
|
||||
pw = NULL;
|
||||
cp = getlogin();
|
||||
if (cp != NULL)
|
||||
@ -452,8 +490,8 @@ main(int argc, char *argv[])
|
||||
pw = getpwuid(getuid());
|
||||
if (pw != NULL) {
|
||||
if (localhome == NULL && !EMPTYSTRING(pw->pw_dir))
|
||||
localhome = xstrdup(pw->pw_dir);
|
||||
localname = xstrdup(pw->pw_name);
|
||||
localhome = ftp_strdup(pw->pw_dir);
|
||||
localname = ftp_strdup(pw->pw_name);
|
||||
anonuser = localname;
|
||||
}
|
||||
if (netrc[0] == '\0' && localhome != NULL) {
|
||||
@ -465,7 +503,7 @@ main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
if (localhome == NULL)
|
||||
localhome = xstrdup("/");
|
||||
localhome = ftp_strdup("/");
|
||||
|
||||
/*
|
||||
* Every anonymous FTP server I've encountered will accept the
|
||||
@ -475,7 +513,7 @@ main(int argc, char *argv[])
|
||||
* - thorpej@NetBSD.org
|
||||
*/
|
||||
len = strlen(anonuser) + 2;
|
||||
anonpass = xmalloc(len);
|
||||
anonpass = ftp_malloc(len);
|
||||
(void)strlcpy(anonpass, anonuser, len);
|
||||
(void)strlcat(anonpass, "@", len);
|
||||
|
||||
@ -502,11 +540,6 @@ main(int argc, char *argv[])
|
||||
(void)xsignal(SIGUSR2, crankrate);
|
||||
(void)xsignal(SIGWINCH, setttywidth);
|
||||
|
||||
#ifdef __GNUC__ /* to shut up gcc warnings */
|
||||
(void)&argc;
|
||||
(void)&argv;
|
||||
#endif
|
||||
|
||||
if (argc > 0) {
|
||||
if (isupload) {
|
||||
rval = auto_put(argc, argv, upload_path);
|
||||
@ -522,22 +555,23 @@ main(int argc, char *argv[])
|
||||
if (rval >= 0) /* -1 == connected and cd-ed */
|
||||
goto sigint_or_rval_exit;
|
||||
} else {
|
||||
char *xargv[4], *user, *host;
|
||||
char *xargv[4], *uuser, *host;
|
||||
char cmdbuf[MAXPATHLEN];
|
||||
|
||||
if ((rval = sigsetjmp(toplevel, 1)))
|
||||
goto sigint_or_rval_exit;
|
||||
(void)xsignal(SIGINT, intr);
|
||||
(void)xsignal(SIGPIPE, lostpeer);
|
||||
user = NULL;
|
||||
uuser = NULL;
|
||||
host = argv[0];
|
||||
cp = strchr(host, '@');
|
||||
if (cp) {
|
||||
*cp = '\0';
|
||||
user = host;
|
||||
uuser = host;
|
||||
host = cp + 1;
|
||||
}
|
||||
/* XXX discards const */
|
||||
xargv[0] = (char *)getprogname();
|
||||
(void)strlcpy(cmdbuf, getprogname(), sizeof(cmdbuf));
|
||||
xargv[0] = cmdbuf;
|
||||
xargv[1] = host;
|
||||
xargv[2] = argv[1];
|
||||
xargv[3] = NULL;
|
||||
@ -545,14 +579,14 @@ main(int argc, char *argv[])
|
||||
int oautologin;
|
||||
|
||||
oautologin = autologin;
|
||||
if (user != NULL) {
|
||||
if (uuser != NULL) {
|
||||
anonftp = 0;
|
||||
autologin = 0;
|
||||
}
|
||||
setpeer(argc+1, xargv);
|
||||
autologin = oautologin;
|
||||
if (connected == 1 && user != NULL)
|
||||
(void)ftp_login(host, user, NULL);
|
||||
if (connected == 1 && uuser != NULL)
|
||||
(void)ftp_login(host, uuser, NULL);
|
||||
if (!retry_connect)
|
||||
break;
|
||||
if (!connected) {
|
||||
@ -586,18 +620,18 @@ main(int argc, char *argv[])
|
||||
char *
|
||||
prompt(void)
|
||||
{
|
||||
static char **prompt;
|
||||
static char **promptopt;
|
||||
static char buf[MAXPATHLEN];
|
||||
|
||||
if (prompt == NULL) {
|
||||
if (promptopt == NULL) {
|
||||
struct option *o;
|
||||
|
||||
o = getoption("prompt");
|
||||
if (o == NULL)
|
||||
errx(1, "no such option `prompt'");
|
||||
prompt = &(o->value);
|
||||
errx(1, "prompt: no such option `prompt'");
|
||||
promptopt = &(o->value);
|
||||
}
|
||||
formatbuf(buf, sizeof(buf), *prompt ? *prompt : DEFAULTPROMPT);
|
||||
formatbuf(buf, sizeof(buf), *promptopt ? *promptopt : DEFAULTPROMPT);
|
||||
return (buf);
|
||||
}
|
||||
|
||||
@ -607,18 +641,18 @@ prompt(void)
|
||||
char *
|
||||
rprompt(void)
|
||||
{
|
||||
static char **rprompt;
|
||||
static char **rpromptopt;
|
||||
static char buf[MAXPATHLEN];
|
||||
|
||||
if (rprompt == NULL) {
|
||||
if (rpromptopt == NULL) {
|
||||
struct option *o;
|
||||
|
||||
o = getoption("rprompt");
|
||||
if (o == NULL)
|
||||
errx(1, "no such option `rprompt'");
|
||||
rprompt = &(o->value);
|
||||
errx(1, "rprompt: no such option `rprompt'");
|
||||
rpromptopt = &(o->value);
|
||||
}
|
||||
formatbuf(buf, sizeof(buf), *rprompt ? *rprompt : DEFAULTRPROMPT);
|
||||
formatbuf(buf, sizeof(buf), *rpromptopt ? *rpromptopt : DEFAULTRPROMPT);
|
||||
return (buf);
|
||||
}
|
||||
|
||||
@ -630,7 +664,12 @@ cmdscanner(void)
|
||||
{
|
||||
struct cmd *c;
|
||||
char *p;
|
||||
int num;
|
||||
#ifndef NO_EDITCOMPLETE
|
||||
int ch;
|
||||
size_t num;
|
||||
#endif
|
||||
int len;
|
||||
char cmdbuf[MAX_C_NAME];
|
||||
|
||||
for (;;) {
|
||||
#ifndef NO_EDITCOMPLETE
|
||||
@ -641,34 +680,33 @@ cmdscanner(void)
|
||||
p = rprompt();
|
||||
if (*p)
|
||||
fprintf(ttyout, "%s ", p);
|
||||
(void)fflush(ttyout);
|
||||
}
|
||||
if (fgets(line, sizeof(line), stdin) == NULL) {
|
||||
(void)fflush(ttyout);
|
||||
len = get_line(stdin, line, sizeof(line), NULL);
|
||||
switch (len) {
|
||||
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);
|
||||
@ -718,7 +756,8 @@ cmdscanner(void)
|
||||
continue;
|
||||
}
|
||||
confirmrest = 0;
|
||||
margv[0] = c->c_name;
|
||||
(void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
|
||||
margv[0] = cmdbuf;
|
||||
(*c->c_handler)(margc, margv);
|
||||
if (bell && c->c_bell)
|
||||
(void)putc('\007', ttyout);
|
||||
@ -777,7 +816,7 @@ makeargv(void)
|
||||
marg_sl->sl_cur = 0; /* reset to start of marg_sl */
|
||||
for (margc = 0; ; margc++) {
|
||||
argp = slurpstring();
|
||||
xsl_add(marg_sl, argp);
|
||||
ftp_sl_add(marg_sl, argp);
|
||||
if (argp == NULL)
|
||||
break;
|
||||
}
|
||||
@ -812,6 +851,8 @@ makeargv(void)
|
||||
char *
|
||||
slurpstring(void)
|
||||
{
|
||||
static char bangstr[2] = { '!', '\0' };
|
||||
static char dollarstr[2] = { '$', '\0' };
|
||||
int got_one = 0;
|
||||
char *sb = stringbase;
|
||||
char *ap = argbase;
|
||||
@ -822,7 +863,7 @@ slurpstring(void)
|
||||
case 0:
|
||||
slrflag++;
|
||||
INC_CHKCURSOR(stringbase);
|
||||
return ((*sb == '!') ? "!" : "$");
|
||||
return ((*sb == '!') ? bangstr : dollarstr);
|
||||
/* NOTREACHED */
|
||||
case 1:
|
||||
slrflag++;
|
||||
@ -945,27 +986,28 @@ void
|
||||
help(int argc, char *argv[])
|
||||
{
|
||||
struct cmd *c;
|
||||
char *nargv[1], *p, *cmd;
|
||||
char *nargv[1], *cmd;
|
||||
const char *p;
|
||||
int isusage;
|
||||
|
||||
cmd = argv[0];
|
||||
isusage = (strcmp(cmd, "usage") == 0);
|
||||
if (argc == 0 || (isusage && argc == 1)) {
|
||||
fprintf(ttyout, "usage: %s [command [...]]\n", cmd);
|
||||
UPRINTF("usage: %s [command [...]]\n", cmd);
|
||||
return;
|
||||
}
|
||||
if (argc == 1) {
|
||||
StringList *buf;
|
||||
|
||||
buf = xsl_init();
|
||||
buf = ftp_sl_init();
|
||||
fprintf(ttyout,
|
||||
"%sommands may be abbreviated. Commands are:\n\n",
|
||||
proxy ? "Proxy c" : "C");
|
||||
for (c = cmdtab; (p = c->c_name) != NULL; c++)
|
||||
if (!proxy || c->c_proxy)
|
||||
xsl_add(buf, p);
|
||||
ftp_sl_add(buf, ftp_strdup(p));
|
||||
list_vertical(buf);
|
||||
sl_free(buf, 0);
|
||||
sl_free(buf, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -973,6 +1015,7 @@ help(int argc, char *argv[])
|
||||
|
||||
while (--argc > 0) {
|
||||
char *arg;
|
||||
char cmdbuf[MAX_C_NAME];
|
||||
|
||||
arg = *++argv;
|
||||
c = getcmd(arg);
|
||||
@ -984,7 +1027,8 @@ help(int argc, char *argv[])
|
||||
cmd, arg);
|
||||
else {
|
||||
if (isusage) {
|
||||
nargv[0] = c->c_name;
|
||||
(void)strlcpy(cmdbuf, c->c_name, sizeof(cmdbuf));
|
||||
nargv[0] = cmdbuf;
|
||||
(*c->c_handler)(0, nargv);
|
||||
} else
|
||||
fprintf(ttyout, "%-*s\t%s\n", HELPINDENT,
|
||||
@ -1014,27 +1058,18 @@ getoptionvalue(const char *name)
|
||||
struct option *c;
|
||||
|
||||
if (name == NULL)
|
||||
errx(1, "getoptionvalue() invoked with NULL name");
|
||||
errx(1, "getoptionvalue: invoked with NULL name");
|
||||
c = getoption(name);
|
||||
if (c != NULL)
|
||||
return (c->value);
|
||||
errx(1, "getoptionvalue() invoked with unknown option `%s'", name);
|
||||
errx(1, "getoptionvalue: invoked with unknown option `%s'", name);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
static void
|
||||
setupoption(char *name, char *value, char *defaultvalue)
|
||||
setupoption(const char *name, const char *value, const char *defaultvalue)
|
||||
{
|
||||
char *nargv[3];
|
||||
int overbose;
|
||||
|
||||
nargv[0] = "setupoption()";
|
||||
nargv[1] = name;
|
||||
nargv[2] = (value ? value : defaultvalue);
|
||||
overbose = verbose;
|
||||
verbose = 0;
|
||||
setoption(3, nargv);
|
||||
verbose = overbose;
|
||||
set_option(name, value ? value : defaultvalue, 0);
|
||||
}
|
||||
|
||||
void
|
||||
@ -1043,9 +1078,10 @@ usage(void)
|
||||
const char *progname = getprogname();
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage: %s [-46AadefginpRtvV] [-N netrc] [-o outfile] [-P port] [-q quittime]\n"
|
||||
" [-r retry] [-T dir,max[,inc][[user@]host [port]]] [host:path[/]]\n"
|
||||
" [file:///file] [ftp://[user[:pass]@]host[:port]/path[/]]\n"
|
||||
"usage: %s [-46AadefginpRtVv] [-N netrc] [-o outfile] [-P port] [-q quittime]\n"
|
||||
" [-r retry] [-s srcaddr] [-T dir,max[,inc]]\n"
|
||||
" [[user@]host [port]] [host:path[/]] [file:///file]\n"
|
||||
" [ftp://[user[:pass]@]host[:port]/path[/]]\n"
|
||||
" [http://[user[:pass]@]host[:port]/path] [...]\n"
|
||||
" %s -u URL file [...]\n", progname, progname);
|
||||
exit(1);
|
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $ */
|
||||
/* $NetBSD: progressbar.c,v 1.14 2009/05/20 12:53:47 lukem Exp $ */
|
||||
/* from NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997-2003 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -36,9 +30,13 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tnftp.h"
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
|
||||
__RCSID(" NetBSD: progressbar.c,v 1.21 2009/04/12 10:18:52 lukem Exp ");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -46,7 +44,6 @@ __RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@ -55,12 +52,12 @@ __RCSID("$NetBSD: progressbar.c,v 1.7 2005/04/11 01:49:31 lukem Exp $");
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <tzfile.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "progressbar.h"
|
||||
#endif /* tnftp */
|
||||
|
||||
#define SECSPERHOUR (60 * 60)
|
||||
#define SECSPERDAY ((long)60 * 60 * 24)
|
||||
#include "progressbar.h"
|
||||
|
||||
#if !defined(NO_PROGRESS)
|
||||
/*
|
||||
@ -72,7 +69,11 @@ foregroundproc(void)
|
||||
static pid_t pgrp = -1;
|
||||
|
||||
if (pgrp == -1)
|
||||
#if GETPGRP_VOID
|
||||
pgrp = getpgrp();
|
||||
#else /* ! GETPGRP_VOID */
|
||||
pgrp = getpgrp(0);
|
||||
#endif /* ! GETPGRP_VOID */
|
||||
|
||||
return (tcgetpgrp(fileno(ttyout)) == pgrp);
|
||||
}
|
||||
@ -94,10 +95,23 @@ updateprogressmeter(int dummy)
|
||||
}
|
||||
|
||||
/*
|
||||
* List of order of magnitude prefixes.
|
||||
* The last is `P', as 2^64 = 16384 Petabytes
|
||||
* List of order of magnitude suffixes, per IEC 60027-2.
|
||||
*/
|
||||
static const char prefixes[] = " KMGTP";
|
||||
static const char * const suffixes[] = {
|
||||
"", /* 2^0 (byte) */
|
||||
"KiB", /* 2^10 Kibibyte */
|
||||
"MiB", /* 2^20 Mebibyte */
|
||||
"GiB", /* 2^30 Gibibyte */
|
||||
"TiB", /* 2^40 Tebibyte */
|
||||
"PiB", /* 2^50 Pebibyte */
|
||||
"EiB", /* 2^60 Exbibyte */
|
||||
#if 0
|
||||
/* The following are not necessary for signed 64-bit off_t */
|
||||
"ZiB", /* 2^70 Zebibyte */
|
||||
"YiB", /* 2^80 Yobibyte */
|
||||
#endif
|
||||
};
|
||||
#define NSUFFIXES (int)(sizeof(suffixes) / sizeof(suffixes[0]))
|
||||
|
||||
/*
|
||||
* Display a transfer progress bar if progress is non-zero.
|
||||
@ -124,7 +138,7 @@ progressmeter(int flag)
|
||||
struct timeval td;
|
||||
off_t abbrevsize, bytespersec;
|
||||
double elapsed;
|
||||
int ratio, barlength, i, remaining;
|
||||
int ratio, i, remaining, barlength;
|
||||
|
||||
/*
|
||||
* Work variables for progress bar.
|
||||
@ -135,10 +149,10 @@ 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 */
|
||||
#define BAROVERHEAD 45 /* non `*' portion of progress bar */
|
||||
/*
|
||||
* stars should contain at least
|
||||
* sizeof(buf) - BAROVERHEAD entries
|
||||
@ -170,8 +184,8 @@ progressmeter(int flag)
|
||||
"transfer aborted because stalled for %lu sec.\r\n",
|
||||
getprogname(), (unsigned long)wait.tv_sec);
|
||||
(void)write(fileno(ttyout), buf, len);
|
||||
(void)xsignal(SIGALRM, SIG_DFL);
|
||||
alarmtimer(0);
|
||||
(void)xsignal(SIGALRM, SIG_DFL);
|
||||
siglongjmp(toplevel, 1);
|
||||
}
|
||||
#endif /* !STANDALONE_PROGRESS */
|
||||
@ -188,8 +202,8 @@ progressmeter(int flag)
|
||||
(void)xsignal_restart(SIGALRM, updateprogressmeter, 1);
|
||||
alarmtimer(1); /* set alarm timer for 1 Hz */
|
||||
} else if (flag == 1) {
|
||||
(void)xsignal(SIGALRM, SIG_DFL);
|
||||
alarmtimer(0);
|
||||
(void)xsignal(SIGALRM, SIG_DFL);
|
||||
}
|
||||
}
|
||||
#ifndef NO_PROGRESS
|
||||
@ -216,23 +230,24 @@ progressmeter(int flag)
|
||||
* calculate the length of the `*' bar, ensuring that
|
||||
* the number of stars won't exceed the buffer size
|
||||
*/
|
||||
barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD;
|
||||
barlength = MIN((int)(sizeof(buf) - 1), ttywidth) - BAROVERHEAD;
|
||||
if (prefix)
|
||||
barlength -= strlen(prefix);
|
||||
barlength -= (int)strlen(prefix);
|
||||
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), "");
|
||||
}
|
||||
}
|
||||
|
||||
abbrevsize = cursize;
|
||||
for (i = 0; abbrevsize >= 100000 && i < sizeof(prefixes); i++)
|
||||
for (i = 0; abbrevsize >= 100000 && i < NSUFFIXES; i++)
|
||||
abbrevsize >>= 10;
|
||||
len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %c%c ",
|
||||
if (i == NSUFFIXES)
|
||||
i--;
|
||||
len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %-3s ",
|
||||
(LLT)abbrevsize,
|
||||
prefixes[i],
|
||||
i == 0 ? ' ' : 'B');
|
||||
suffixes[i]);
|
||||
|
||||
timersub(&now, &start, &td);
|
||||
elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
|
||||
@ -243,13 +258,13 @@ progressmeter(int flag)
|
||||
if (elapsed > 0.0)
|
||||
bytespersec /= elapsed;
|
||||
}
|
||||
for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
|
||||
for (i = 1; bytespersec >= 1024000 && i < NSUFFIXES; i++)
|
||||
bytespersec >>= 10;
|
||||
len += snprintf(buf + len, BUFLEFT,
|
||||
" " LLFP("3") ".%02d %cB/s ",
|
||||
" " LLFP("3") ".%02d %.2sB/s ",
|
||||
(LLT)(bytespersec / 1024),
|
||||
(int)((bytespersec % 1024) * 100 / 1024),
|
||||
prefixes[i]);
|
||||
suffixes[i]);
|
||||
|
||||
if (filesize > 0) {
|
||||
if (bytes <= 0 || elapsed <= 0.0 || cursize > filesize) {
|
||||
@ -299,7 +314,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. */
|
||||
|
||||
@ -334,12 +350,14 @@ ptransfer(int siginfo)
|
||||
len += snprintf(buf + len, BUFLEFT,
|
||||
"%02d:%02d ", remaining / 60, remaining % 60);
|
||||
|
||||
for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++)
|
||||
for (i = 1; bytespersec >= 1024000 && i < NSUFFIXES; i++)
|
||||
bytespersec >>= 10;
|
||||
len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %cB/s)",
|
||||
if (i == NSUFFIXES)
|
||||
i--;
|
||||
len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %.2sB/s)",
|
||||
(LLT)(bytespersec / 1024),
|
||||
(int)((bytespersec % 1024) * 100 / 1024),
|
||||
prefixes[i]);
|
||||
suffixes[i]);
|
||||
|
||||
if (siginfo && bytes > 0 && elapsed > 0.0 && filesize >= 0
|
||||
&& bytes + restart_point <= filesize) {
|
||||
@ -400,6 +418,16 @@ alarmtimer(int wait)
|
||||
sigfunc
|
||||
xsignal_restart(int sig, sigfunc func, int restartable)
|
||||
{
|
||||
#ifdef ultrix /* XXX: this is lame - how do we test sigvec vs. sigaction? */
|
||||
struct sigvec vec, ovec;
|
||||
|
||||
vec.sv_handler = func;
|
||||
sigemptyset(&vec.sv_mask);
|
||||
vec.sv_flags = 0;
|
||||
if (sigvec(sig, &vec, &ovec) < 0)
|
||||
return (SIG_ERR);
|
||||
return (ovec.sv_handler);
|
||||
#else /* ! ultrix */
|
||||
struct sigaction act, oact;
|
||||
act.sa_handler = func;
|
||||
|
||||
@ -414,6 +442,7 @@ xsignal_restart(int sig, sigfunc func, int restartable)
|
||||
if (sigaction(sig, &act, &oact) < 0)
|
||||
return (SIG_ERR);
|
||||
return (oact.sa_handler);
|
||||
#endif /* ! ultrix */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -457,7 +486,7 @@ xsignal(int sig, sigfunc func)
|
||||
* This is unpleasant, but I don't know what would be better.
|
||||
* Right now, this "can't happen"
|
||||
*/
|
||||
errx(1, "xsignal_restart called with signal %d", sig);
|
||||
errx(1, "xsignal_restart: called with signal %d", sig);
|
||||
}
|
||||
|
||||
return(xsignal_restart(sig, func, restartable));
|
@ -1,7 +1,8 @@
|
||||
/* $NetBSD: progressbar.h,v 1.5 2005/02/10 16:00:38 jmc Exp $ */
|
||||
/* $NetBSD: progressbar.h,v 1.9 2009/05/20 12:53:47 lukem Exp $ */
|
||||
/* from NetBSD: progressbar.h,v 1.8 2009/04/12 10:18:52 lukem Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996-2003 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -15,13 +16,6 @@
|
||||
* 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
|
||||
@ -66,7 +60,7 @@ GLOBAL int fromatty; /* input is from a terminal */
|
||||
GLOBAL int verbose; /* print messages coming back from server */
|
||||
GLOBAL int quit_time; /* maximum time to wait if stalled */
|
||||
|
||||
GLOBAL char *direction; /* direction transfer is occurring */
|
||||
GLOBAL const char *direction; /* direction transfer is occurring */
|
||||
|
||||
GLOBAL sigjmp_buf toplevel; /* non-local goto stuff for cmd scanner */
|
||||
#endif /* !STANDALONE_PROGRESS */
|
||||
@ -90,10 +84,19 @@ void ptransfer(int);
|
||||
# define ULLFP(x) "%" x "lu"
|
||||
# define ULLT unsigned long
|
||||
#else
|
||||
#if defined(HAVE_PRINTF_QD)
|
||||
# define LLF "%qd"
|
||||
# define LLFP(x) "%" x "qd"
|
||||
# define LLT long long
|
||||
# define ULLF "%qu"
|
||||
# define ULLFP(x) "%" x "qu"
|
||||
# define ULLT unsigned long long
|
||||
#else /* !defined(HAVE_PRINTF_QD) */
|
||||
# define LLF "%lld"
|
||||
# define LLFP(x) "%" x "lld"
|
||||
# define LLT long long
|
||||
# define ULLF "%llu"
|
||||
# define ULLFP(x) "%" x "llu"
|
||||
# define ULLT unsigned long long
|
||||
#endif /* !defined(HAVE_PRINTF_QD) */
|
||||
#endif
|
@ -1,4 +1,5 @@
|
||||
/* $NetBSD: ruserpass.c,v 1.29 2003/08/07 11:13:57 agc Exp $ */
|
||||
/* $NetBSD: ruserpass.c,v 1.8 2007/08/06 04:33:24 lukem Exp $ */
|
||||
/* from NetBSD: ruserpass.c,v 1.33 2007/04/17 05:52:04 lukem Exp */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1985, 1993, 1994
|
||||
@ -29,12 +30,16 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "tnftp.h"
|
||||
|
||||
#if 0 /* tnftp */
|
||||
|
||||
#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.29 2003/08/07 11:13:57 agc Exp $");
|
||||
__RCSID(" NetBSD: ruserpass.c,v 1.33 2007/04/17 05:52:04 lukem Exp ");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -50,6 +55,8 @@ __RCSID("$NetBSD: ruserpass.c,v 1.29 2003/08/07 11:13:57 agc Exp $");
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#endif /* tnftp */
|
||||
|
||||
#include "ftp_var.h"
|
||||
|
||||
static int token(void);
|
||||
@ -66,7 +73,7 @@ static FILE *cfile;
|
||||
static char tokval[100];
|
||||
|
||||
static struct toktab {
|
||||
char *tokstr;
|
||||
const char *tokstr;
|
||||
int tval;
|
||||
} toktab[] = {
|
||||
{ "default", DEFAULT },
|
||||
@ -80,11 +87,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;
|
||||
|
||||
@ -93,7 +100,7 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
cfile = fopen(netrc, "r");
|
||||
if (cfile == NULL) {
|
||||
if (errno != ENOENT)
|
||||
warn("%s", netrc);
|
||||
warn("Can't read `%s'", netrc);
|
||||
return (0);
|
||||
}
|
||||
if (gethostname(myname, sizeof(myname)) < 0)
|
||||
@ -102,7 +109,7 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
if ((mydomain = strchr(myname, '.')) == NULL)
|
||||
mydomain = "";
|
||||
next:
|
||||
while ((t = token())) switch(t) {
|
||||
while ((t = token()) > 0) switch(t) {
|
||||
|
||||
case DEFAULT:
|
||||
usedefault = 1;
|
||||
@ -110,7 +117,9 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
|
||||
case MACH:
|
||||
if (!usedefault) {
|
||||
if (token() != ID)
|
||||
if ((t = token()) == -1)
|
||||
goto bad;
|
||||
if (t != ID)
|
||||
continue;
|
||||
/*
|
||||
* Allow match either for user's input host name
|
||||
@ -134,12 +143,15 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
continue;
|
||||
}
|
||||
match:
|
||||
while ((t = token()) && t != MACH && t != DEFAULT) switch(t) {
|
||||
while ((t = token()) > 0 &&
|
||||
t != MACH && t != DEFAULT) switch(t) {
|
||||
|
||||
case LOGIN:
|
||||
if (token()) {
|
||||
if ((t = token()) == -1)
|
||||
goto bad;
|
||||
if (t) {
|
||||
if (*aname == NULL)
|
||||
*aname = xstrdup(tokval);
|
||||
*aname = ftp_strdup(tokval);
|
||||
else {
|
||||
if (strcmp(*aname, tokval))
|
||||
goto next;
|
||||
@ -150,22 +162,26 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
if ((*aname == NULL || strcmp(*aname, "anonymous")) &&
|
||||
fstat(fileno(cfile), &stb) >= 0 &&
|
||||
(stb.st_mode & 077) != 0) {
|
||||
warnx("Error: .netrc file is readable by others.");
|
||||
warnx("Remove password or make file unreadable by others.");
|
||||
warnx("Error: .netrc file is readable by others");
|
||||
warnx("Remove password or make file unreadable by others");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *apass == NULL)
|
||||
*apass = xstrdup(tokval);
|
||||
if ((t = token()) == -1)
|
||||
goto bad;
|
||||
if (t && *apass == NULL)
|
||||
*apass = ftp_strdup(tokval);
|
||||
break;
|
||||
case ACCOUNT:
|
||||
if (fstat(fileno(cfile), &stb) >= 0
|
||||
&& (stb.st_mode & 077) != 0) {
|
||||
warnx("Error: .netrc file is readable by others.");
|
||||
warnx("Remove account or make file unreadable by others.");
|
||||
warnx("Error: .netrc file is readable by others");
|
||||
warnx("Remove account or make file unreadable by others");
|
||||
goto bad;
|
||||
}
|
||||
if (token() && *aacct == NULL)
|
||||
*aacct = xstrdup(tokval);
|
||||
if ((t = token()) == -1)
|
||||
goto bad;
|
||||
if (t && *aacct == NULL)
|
||||
*aacct = ftp_strdup(tokval);
|
||||
break;
|
||||
case MACDEF:
|
||||
if (proxy) {
|
||||
@ -225,9 +241,13 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
}
|
||||
*tmp = c;
|
||||
if (*tmp == '\n') {
|
||||
if (*(tmp-1) == '\0') {
|
||||
macros[macnum++].mac_end = tmp - 1;
|
||||
break;
|
||||
if (tmp == macros[macnum].mac_start) {
|
||||
macros[macnum++].mac_end = tmp;
|
||||
break;
|
||||
} else if (*(tmp - 1) == '\0') {
|
||||
macros[macnum++].mac_end =
|
||||
tmp - 1;
|
||||
break;
|
||||
}
|
||||
*tmp = '\0';
|
||||
}
|
||||
@ -240,12 +260,14 @@ ruserpass(const char *host, const char **aname, const char **apass,
|
||||
}
|
||||
break;
|
||||
default:
|
||||
warnx("Unknown .netrc keyword %s", tokval);
|
||||
warnx("Unknown .netrc keyword `%s'", tokval);
|
||||
break;
|
||||
}
|
||||
goto done;
|
||||
}
|
||||
done:
|
||||
if (t == -1)
|
||||
goto bad;
|
||||
(void)fclose(cfile);
|
||||
return (0);
|
||||
bad:
|
||||
@ -271,16 +293,26 @@ token(void)
|
||||
if (c == '"') {
|
||||
while ((c = getc(cfile)) != EOF && c != '"') {
|
||||
if (c == '\\')
|
||||
c = getc(cfile);
|
||||
if ((c = getc(cfile)) == EOF)
|
||||
break;
|
||||
*cp++ = c;
|
||||
if (cp == tokval + sizeof(tokval)) {
|
||||
warnx("Token in .netrc too long");
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
*cp++ = c;
|
||||
while ((c = getc(cfile)) != EOF
|
||||
&& c != '\n' && c != '\t' && c != ' ' && c != ',') {
|
||||
if (c == '\\')
|
||||
c = getc(cfile);
|
||||
if ((c = getc(cfile)) == EOF)
|
||||
break;
|
||||
*cp++ = c;
|
||||
if (cp == tokval + sizeof(tokval)) {
|
||||
warnx("Token in .netrc too long");
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
*cp = 0;
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,8 @@
|
||||
/* $NetBSD: version.h,v 1.50 2005/05/14 15:26:43 lukem Exp $ */
|
||||
/* $NetBSD: version.h,v 1.4 2009/11/15 10:12:37 lukem Exp $ */
|
||||
/* from NetBSD: version.h,v 1.80 2009/11/15 10:03:16 lukem Exp */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999-2005 The NetBSD Foundation, Inc.
|
||||
* Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
@ -14,13 +16,6 @@
|
||||
* 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
|
||||
@ -40,5 +35,5 @@
|
||||
#endif
|
||||
|
||||
#ifndef FTP_VERSION
|
||||
#define FTP_VERSION "20050514"
|
||||
#define FTP_VERSION "20090915"
|
||||
#endif
|
495
contrib/tnftp/tnftp.h
Normal file
495
contrib/tnftp/tnftp.h
Normal file
@ -0,0 +1,495 @@
|
||||
/* $NetBSD: tnftp.h,v 1.33 2009/11/14 08:32:42 lukem Exp $ */
|
||||
|
||||
#define FTP_PRODUCT PACKAGE_NAME
|
||||
#define FTP_VERSION PACKAGE_VERSION
|
||||
|
||||
#include "tnftp_config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(HAVE_SYS_TYPES_H)
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
#if defined(STDC_HEADERS)
|
||||
# include <stdarg.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
#endif
|
||||
#if defined(HAVE_LIBGEN_H)
|
||||
# include <libgen.h>
|
||||
#endif
|
||||
#if defined(HAVE_UNISTD_H)
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#if defined(HAVE_POLL_H)
|
||||
# include <poll.h>
|
||||
#elif defined(HAVE_SYS_POLL_H)
|
||||
# include <sys/poll.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_SOCKET_H)
|
||||
# include <sys/socket.h>
|
||||
#endif
|
||||
#if defined(HAVE_NETINET_IN_H)
|
||||
# include <netinet/in.h>
|
||||
#endif
|
||||
#if defined(HAVE_NETINET_IN_SYSTM_H)
|
||||
# include <netinet/in_systm.h>
|
||||
#endif
|
||||
#if defined(HAVE_NETINET_IP_H)
|
||||
# include <netinet/ip.h>
|
||||
#endif
|
||||
#if defined(HAVE_NETDB_H)
|
||||
# if HAVE_DECL_AI_NUMERICHOST
|
||||
# include <netdb.h>
|
||||
# else /* !HAVE_DECL_AI_NUMERICHOST */
|
||||
# define getaddrinfo non_rfc2553_getaddrinfo
|
||||
# include <netdb.h>
|
||||
# undef getaddrinfo
|
||||
# endif /* !HAVE_DECL_AI_NUMERICHOST */
|
||||
#endif
|
||||
#if defined(HAVE_ARPA_INET_H)
|
||||
# include <arpa/inet.h>
|
||||
#endif
|
||||
#if defined(HAVE_DIRENT_H)
|
||||
# include <dirent.h>
|
||||
#else
|
||||
# define dirent direct
|
||||
# if defined(HAVE_SYS_NDIR_H)
|
||||
# include <sys/ndir.h>
|
||||
# endif
|
||||
# if defined(HAVE_SYS_DIR_H)
|
||||
# include <sys/dir.h>
|
||||
# endif
|
||||
# if defined(HAVE_NDIR_H)
|
||||
# include <ndir.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYS_IOCTL_H)
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_PARAM_H)
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_STAT_H)
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_SYSLIMITS_H)
|
||||
# include <sys/syslimits.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_WAIT_H)
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ARPA_FTP_H)
|
||||
# include <arpa/ftp.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FCNTL_H)
|
||||
# include <fcntl.h>
|
||||
#endif
|
||||
#if defined(HAVE_LIMITS_H)
|
||||
# include <limits.h>
|
||||
#endif
|
||||
#if defined(HAVE_PWD_H)
|
||||
# include <pwd.h>
|
||||
#endif
|
||||
#if defined(HAVE_SETJMP_H)
|
||||
# include <setjmp.h>
|
||||
#endif
|
||||
#if defined(HAVE_SIGNAL_H)
|
||||
# include <signal.h>
|
||||
#endif
|
||||
#if defined(HAVE_STDDEF_H)
|
||||
# include <stddef.h>
|
||||
#endif
|
||||
#if defined(HAVE_TERMIOS_H)
|
||||
# include <termios.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_POLL)
|
||||
/* we use poll */
|
||||
#elif defined(HAVE_SELECT)
|
||||
/* we use select */
|
||||
#else /* !defined(HAVE_POLL) && !defined(HAVE_SELECT) */
|
||||
# error "no poll() or select() found"
|
||||
#endif
|
||||
#if !defined(POLLIN)
|
||||
# define POLLIN 0x0001
|
||||
#endif
|
||||
#if !defined(POLLOUT)
|
||||
# define POLLOUT 0x0004
|
||||
#endif
|
||||
#if !defined(POLLRDNORM)
|
||||
# define POLLRDNORM 0x0040
|
||||
#endif
|
||||
#if !defined(POLLWRNORM)
|
||||
# define POLLWRNORM POLLOUT
|
||||
#endif
|
||||
#if !defined(POLLRDBAND)
|
||||
# define POLLRDBAND 0x0080
|
||||
#endif
|
||||
#if !defined(INFTIM)
|
||||
# define INFTIM -1
|
||||
#endif
|
||||
#if !defined(HAVE_STRUCT_POLLFD)
|
||||
struct pollfd {
|
||||
int fd;
|
||||
short events;
|
||||
short revents;
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(TIME_WITH_SYS_TIME)
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if defined(HAVE_SYS_TIME_H)
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_ERR_H)
|
||||
# include <err.h>
|
||||
#endif
|
||||
|
||||
#if defined(USE_GLOB_H) /* not set by configure; used by other build systems */
|
||||
# include <glob.h>
|
||||
#else
|
||||
# include "ftpglob.h"
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_PATHS_H)
|
||||
# include <paths.h>
|
||||
#endif
|
||||
#if !defined(_PATH_BSHELL)
|
||||
# define _PATH_BSHELL "/bin/sh"
|
||||
#endif
|
||||
#if !defined(_PATH_TMP)
|
||||
# define _PATH_TMP "/tmp/"
|
||||
#endif
|
||||
|
||||
typedef struct _stringlist {
|
||||
char **sl_str;
|
||||
size_t sl_max;
|
||||
size_t sl_cur;
|
||||
} StringList;
|
||||
|
||||
StringList *sl_init(void);
|
||||
int sl_add(StringList *, char *);
|
||||
void sl_free(StringList *, int);
|
||||
char *sl_find(StringList *, char *);
|
||||
|
||||
#if defined(HAVE_TERMCAP_H)
|
||||
# include <termcap.h>
|
||||
#else
|
||||
int tgetent(char *, const char *);
|
||||
char *tgetstr(const char *, char **);
|
||||
int tgetflag(const char *);
|
||||
int tgetnum(const char *);
|
||||
char *tgoto(const char *, int, int);
|
||||
void tputs(const char *, int, int (*)(int));
|
||||
#endif /* !HAVE_TERMCAP_H */
|
||||
|
||||
#if defined(HAVE_VIS_H) && defined(HAVE_STRVIS) && defined(HAVE_STRUNVIS)
|
||||
# include <vis.h>
|
||||
#else
|
||||
# include "ftpvis.h"
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_IN_PORT_T)
|
||||
typedef unsigned short in_port_t;
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SA_FAMILY_T)
|
||||
typedef unsigned short sa_family_t;
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SOCKLEN_T)
|
||||
typedef unsigned int socklen_t;
|
||||
#endif
|
||||
|
||||
#if defined(USE_INET6)
|
||||
# define INET6
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_AI_NUMERICHOST
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef EAI_ADDRFAMILY
|
||||
#define EAI_ADDRFAMILY 1 /* address family for hostname not supported */
|
||||
#undef EAI_AGAIN
|
||||
#define EAI_AGAIN 2 /* temporary failure in name resolution */
|
||||
#undef EAI_BADFLAGS
|
||||
#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
|
||||
#undef EAI_FAIL
|
||||
#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
|
||||
#undef EAI_FAMILY
|
||||
#define EAI_FAMILY 5 /* ai_family not supported */
|
||||
#undef EAI_MEMORY
|
||||
#define EAI_MEMORY 6 /* memory allocation failure */
|
||||
#undef EAI_NODATA
|
||||
#define EAI_NODATA 7 /* no address associated with hostname */
|
||||
#undef EAI_NONAME
|
||||
#define EAI_NONAME 8 /* hostname nor servname provided, or not known */
|
||||
#undef EAI_SERVICE
|
||||
#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
|
||||
#undef EAI_SOCKTYPE
|
||||
#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
|
||||
#undef EAI_SYSTEM
|
||||
#define EAI_SYSTEM 11 /* system error returned in errno */
|
||||
|
||||
/* KAME extensions? */
|
||||
#undef EAI_BADHINTS
|
||||
#define EAI_BADHINTS 12
|
||||
#undef EAI_PROTOCOL
|
||||
#define EAI_PROTOCOL 13
|
||||
#undef EAI_MAX
|
||||
#define EAI_MAX 14
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef NI_MAXHOST
|
||||
#define NI_MAXHOST 1025
|
||||
#undef NI_MAXSERV
|
||||
#define NI_MAXSERV 32
|
||||
|
||||
#undef NI_NOFQDN
|
||||
#define NI_NOFQDN 0x00000001
|
||||
#undef NI_NUMERICHOST
|
||||
#define NI_NUMERICHOST 0x00000002
|
||||
#undef NI_NAMEREQD
|
||||
#define NI_NAMEREQD 0x00000004
|
||||
#undef NI_NUMERICSERV
|
||||
#define NI_NUMERICSERV 0x00000008
|
||||
#undef NI_DGRAM
|
||||
#define NI_DGRAM 0x00000010
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef AI_PASSIVE
|
||||
#define AI_PASSIVE 0x00000001 /* get address to use bind() */
|
||||
#undef AI_CANONNAME
|
||||
#define AI_CANONNAME 0x00000002 /* fill ai_canonname */
|
||||
|
||||
/* KAME extensions ? */
|
||||
#undef AI_NUMERICHOST
|
||||
#define AI_NUMERICHOST 0x00000004 /* prevent name resolution */
|
||||
#undef AI_MASK
|
||||
#define AI_MASK (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST)
|
||||
|
||||
/* RFC 2553 */
|
||||
#undef AI_ALL
|
||||
#define AI_ALL 0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
|
||||
#undef AI_V4MAPPED_CFG
|
||||
#define AI_V4MAPPED_CFG 0x00000200 /* accept IPv4-mapped if kernel supports */
|
||||
#undef AI_ADDRCONFIG
|
||||
#define AI_ADDRCONFIG 0x00000400 /* only if any address is assigned */
|
||||
#undef AI_V4MAPPED
|
||||
#define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */
|
||||
|
||||
#endif /* !HAVE_DECL_AI_NUMERICHOST */
|
||||
|
||||
|
||||
#if !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \
|
||||
&& !defined(USE_SOCKS)
|
||||
|
||||
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 */
|
||||
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);
|
||||
void freeaddrinfo(struct addrinfo *);
|
||||
const char *gai_strerror(int);
|
||||
|
||||
#endif /* !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \
|
||||
&& !defined(USE_SOCKS) */
|
||||
|
||||
#if !defined(HAVE_STRUCT_DIRENT_D_NAMLEN)
|
||||
# define DIRENT_MISSING_D_NAMLEN
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_H_ERRNO
|
||||
extern int h_errno;
|
||||
#endif
|
||||
#define HAVE_H_ERRNO 1 /* XXX: an assumption for now... */
|
||||
|
||||
#if !HAVE_DECL_FCLOSE
|
||||
int fclose(FILE *);
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_GETPASS
|
||||
char *getpass(const char *);
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_OPTARG
|
||||
extern char *optarg;
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_OPTIND
|
||||
extern int optind;
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_PCLOSE
|
||||
int pclose(FILE *);
|
||||
#endif
|
||||
|
||||
#if !HAVE_DECL_DIRNAME
|
||||
char *dirname(char *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_ERR)
|
||||
void err(int, const char *, ...);
|
||||
void errx(int, const char *, ...);
|
||||
void warn(const char *, ...);
|
||||
void warnx(const char *, ...);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_FGETLN)
|
||||
char *fgetln(FILE *, size_t *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_FSEEKO)
|
||||
int fseeko(FILE *, off_t, int);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_INET_NTOP)
|
||||
const char *inet_ntop(int, const void *, char *, socklen_t);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_INET_PTON)
|
||||
int inet_pton(int, const char *, void *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_MKSTEMP)
|
||||
int mkstemp(char *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SETPROGNAME)
|
||||
const char *getprogname(void);
|
||||
void setprogname(const char *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_SNPRINTF)
|
||||
int snprintf(char *, size_t, const char *, ...);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRDUP)
|
||||
char *strdup(const char *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRERROR)
|
||||
char *strerror(int);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRPTIME) || !HAVE_DECL_STRPTIME
|
||||
char *strptime(const char *, const char *, struct tm *);
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)
|
||||
# if !defined(HAVE_STRTOLL)
|
||||
long long strtoll(const char *, char **, int);
|
||||
# endif
|
||||
# if !defined(LLONG_MIN)
|
||||
# define LLONG_MIN (-0x7fffffffffffffffLL-1)
|
||||
# endif
|
||||
# if !defined(LLONG_MAX)
|
||||
# define LLONG_MAX (0x7fffffffffffffffLL)
|
||||
# endif
|
||||
#else /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */
|
||||
# define NO_LONG_LONG 1
|
||||
#endif /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */
|
||||
|
||||
#if !defined(HAVE_TIMEGM)
|
||||
time_t timegm(struct tm *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRLCAT)
|
||||
size_t strlcat(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRLCPY)
|
||||
size_t strlcpy(char *, const char *, size_t);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_STRSEP)
|
||||
char *strsep(char **stringp, const char *delim);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_UTIMES)
|
||||
int utimes(const char *, const struct timeval *);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_MEMMOVE)
|
||||
# define memmove(a,b,c) bcopy((b),(a),(c))
|
||||
/* XXX: add others #defines for borken systems? */
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_GETPASSPHRASE)
|
||||
# define getpass getpassphrase
|
||||
#endif
|
||||
|
||||
#if !defined(MIN)
|
||||
# define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
#if !defined(MAX)
|
||||
# define MAX(a, b) ((a) < (b) ? (b) : (a))
|
||||
#endif
|
||||
|
||||
#if !defined(timersub)
|
||||
# define timersub(tvp, uvp, vvp) \
|
||||
do { \
|
||||
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
|
||||
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
|
||||
if ((vvp)->tv_usec < 0) { \
|
||||
(vvp)->tv_sec--; \
|
||||
(vvp)->tv_usec += 1000000; \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#if !defined(S_ISLNK)
|
||||
# define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK)
|
||||
#endif
|
||||
|
||||
#define EPOCH_YEAR 1970
|
||||
#define SECSPERHOUR 3600
|
||||
#define SECSPERDAY 86400
|
||||
#define TM_YEAR_BASE 1900
|
||||
|
||||
#if defined(USE_SOCKS) /* (Dante) SOCKS5 */
|
||||
#define connect Rconnect
|
||||
#define bind Rbind
|
||||
#define getsockname Rgetsockname
|
||||
#define getpeername Rgetpeername
|
||||
#define accept Raccept
|
||||
#define rresvport Rrresvport
|
||||
#define bindresvport Rbindresvport
|
||||
#define gethostbyname Rgethostbyname
|
||||
#define gethostbyname2 Rgethostbyname2
|
||||
#define sendto Rsendto
|
||||
#define recvfrom Rrecvfrom
|
||||
#define recvfrom Rrecvfrom
|
||||
#define write Rwrite
|
||||
#define writev Rwritev
|
||||
#define send Rsend
|
||||
#define sendmsg Rsendmsg
|
||||
#define read Rread
|
||||
#define readv Rreadv
|
||||
#define recv Rrecv
|
||||
#define recvmsg Rrecvmsg
|
||||
#define getaddrinfo Rgetaddrinfo
|
||||
#define getipnodebyname Rgetipnodebyname
|
||||
#endif /* defined(USE_SOCKS) */
|
25
contrib/tnftp/todo
Normal file
25
contrib/tnftp/todo
Normal file
@ -0,0 +1,25 @@
|
||||
$NetBSD: todo,v 1.12 2008/12/20 15:17:58 lukem Exp $
|
||||
|
||||
Current Items
|
||||
-------------
|
||||
|
||||
autoconf test for HAVE_DECL_GETADDRINFO if providing getaddrinfo() override.
|
||||
(required for UnixWare 7.1.1)
|
||||
|
||||
Interix may need hack to fix detection of getpgrp() void args.
|
||||
(See pkgsrc/net/tnftp/files/src/progressbar.c 1.2)
|
||||
|
||||
Old Items
|
||||
---------
|
||||
|
||||
add locale autoconf checks
|
||||
|
||||
in configure, check for ansi c compiler and barf if it fails
|
||||
|
||||
check if we need #defines for memcpy() et al
|
||||
|
||||
possibly install editline.3 and editrc.5
|
||||
|
||||
system specific tests (to remove need for manual intervention):
|
||||
- sunos4
|
||||
LIBS+= -lresolv
|
@ -698,7 +698,7 @@ char *text;
|
||||
int width;
|
||||
|
||||
s = NULL;
|
||||
width = screen_width;
|
||||
width = display_width;
|
||||
header_length = strlen(text);
|
||||
if (header_length >= width) {
|
||||
s = malloc((width + 1) * sizeof(char));
|
||||
@ -706,14 +706,6 @@ char *text;
|
||||
return (NULL);
|
||||
strncpy(s, text, width);
|
||||
s[width] = '\0';
|
||||
} else {
|
||||
s = malloc((width + 1) * sizeof(char));
|
||||
if (s == NULL)
|
||||
return (NULL);
|
||||
strncpy(s, text, width);
|
||||
while (screen_width > header_length)
|
||||
s[header_length++] = ' ';
|
||||
s[width] = '\0';
|
||||
}
|
||||
return (s);
|
||||
}
|
||||
@ -738,7 +730,7 @@ char *text;
|
||||
if (header_status == ON)
|
||||
{
|
||||
putchar('\n');
|
||||
standout(text, stdout);
|
||||
fputs(text, stdout);
|
||||
lastline++;
|
||||
}
|
||||
else if (header_status == ERASE)
|
||||
|
@ -14,7 +14,7 @@
|
||||
extern int Header_lines; /* 7 */
|
||||
|
||||
/* Maximum number of columns allowed for display */
|
||||
#define MAX_COLS 512
|
||||
#define MAX_COLS 128
|
||||
|
||||
/* Log base 2 of 1024 is 10 (2^10 == 1024) */
|
||||
#define LOG1024 10
|
||||
|
@ -444,6 +444,13 @@ ubthidhci_enable="NO" # Switch an USB BT controller present on
|
||||
#ubthidhci_addr="2" # Check usbconfig list to find the correct
|
||||
# numbers for your system.
|
||||
|
||||
### Network link/usability verification options
|
||||
netwait_enable="NO" # Enable rc.d/netwait (or NO)
|
||||
#netwait_ip="" # IP addresses to be pinged by netwait.
|
||||
netwait_timeout="60" # Total number of seconds to perform pings.
|
||||
#netwait_if="" # Interface name to watch link state on.
|
||||
netwait_if_timeout="30" # Total number of seconds to monitor link state.
|
||||
|
||||
### Miscellaneous network options: ###
|
||||
icmp_bmcastecho="NO" # respond to broadcast ping packets
|
||||
|
||||
|
@ -22,7 +22,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKING SERVERS \
|
||||
ldconfig local localpkg lockd lpd \
|
||||
mixer motd mountcritlocal mountcritremote mountlate \
|
||||
mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \
|
||||
named natd netif netoptions \
|
||||
named natd netif netoptions netwait \
|
||||
newsyslog nfsclient nfscbd nfsd \
|
||||
nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \
|
||||
othermta \
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
|
||||
# PROVIDE: mountcritremote
|
||||
# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec
|
||||
# REQUIRE: NETWORKING FILESYSTEMS cleanvar ipsec netwait
|
||||
# KEYWORD: nojail
|
||||
|
||||
. /etc/rc.subr
|
||||
|
97
etc/rc.d/netwait
Executable file
97
etc/rc.d/netwait
Executable file
@ -0,0 +1,97 @@
|
||||
#!/bin/sh
|
||||
|
||||
# $FreeBSD$
|
||||
#
|
||||
# PROVIDE: netwait
|
||||
# REQUIRE: NETWORKING
|
||||
# KEYWORD: nojail
|
||||
#
|
||||
# The netwait script is intended to be used by systems which have
|
||||
# statically-configured IP addresses in rc.conf(5). If your system
|
||||
# uses DHCP, you should use synchronous_dhclient="YES" in your
|
||||
# /etc/rc.conf instead of using netwait.
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="netwait"
|
||||
rc_var=`set_rcvar`
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd=":"
|
||||
|
||||
netwait_start()
|
||||
{
|
||||
local ip rc count output link
|
||||
|
||||
if [ -z "${netwait_ip}" ]; then
|
||||
err 1 "You must define one or more IP addresses in netwait_ip"
|
||||
fi
|
||||
|
||||
if [ ${netwait_timeout} -lt 1 ]; then
|
||||
err 1 "netwait_timeout must be >= 1"
|
||||
fi
|
||||
|
||||
# Handle SIGINT (Ctrl-C); force abort of while() loop
|
||||
trap break SIGINT
|
||||
|
||||
if [ -n "${netwait_if}" ]; then
|
||||
echo -n "Waiting for $netwait_if to have link"
|
||||
|
||||
count=1
|
||||
while [ ${count} -le ${netwait_if_timeout} ]; do
|
||||
if output=`/sbin/ifconfig ${netwait_if} 2>/dev/null`; then
|
||||
link=`expr "${output}" : '.*[[:blank:]]status: \(no carrier\)'`
|
||||
if [ -z "${link}" ]; then
|
||||
echo '.'
|
||||
break
|
||||
fi
|
||||
else
|
||||
echo ''
|
||||
err 1 "ifconfig ${netwait_if} failed"
|
||||
fi
|
||||
sleep 1
|
||||
count=$((count+1))
|
||||
done
|
||||
if [ -n "${link}" ]; then
|
||||
# Restore default SIGINT handler
|
||||
trap - SIGINT
|
||||
|
||||
echo ''
|
||||
warn "Interface still has no link. Continuing with startup, but"
|
||||
warn "be aware you may not have a fully functional networking"
|
||||
warn "layer at this point."
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
# Handle SIGINT (Ctrl-C); force abort of while() loop
|
||||
trap break SIGINT
|
||||
|
||||
for ip in ${netwait_ip}; do
|
||||
echo -n "Waiting for ${ip} to respond to ICMP"
|
||||
|
||||
count=1
|
||||
while [ ${count} -le ${netwait_timeout} ]; do
|
||||
/sbin/ping -t 1 -c 1 -o ${ip} >/dev/null 2>&1
|
||||
rc=$?
|
||||
|
||||
if [ $rc -eq 0 ]; then
|
||||
# Restore default SIGINT handler
|
||||
trap - SIGINT
|
||||
|
||||
echo '.'
|
||||
return
|
||||
fi
|
||||
count=$((count+1))
|
||||
done
|
||||
echo ': No response from host.'
|
||||
done
|
||||
|
||||
# Restore default SIGINT handler
|
||||
trap - SIGINT
|
||||
|
||||
warn "Exhausted IP list. Continuing with startup, but be aware you may"
|
||||
warn "not have a fully functional networking layer at this point."
|
||||
}
|
||||
|
||||
load_rc_config $name
|
||||
run_rc_command "$1"
|
@ -1732,8 +1732,6 @@ check_required_after()
|
||||
return 0
|
||||
}
|
||||
|
||||
fi
|
||||
|
||||
# check_kern_features mib
|
||||
# Return existence of kern.features.* sysctl MIB as true or
|
||||
# false. The result will be cached in $_rc_cache_kern_features_
|
||||
@ -1775,4 +1773,6 @@ _echoonce()
|
||||
esac
|
||||
}
|
||||
|
||||
fi # [ -z "${_rc_subr_loaded}" ]
|
||||
|
||||
_rc_subr_loaded=:
|
||||
|
@ -171,9 +171,8 @@ medium:
|
||||
}
|
||||
/* set z = scalbn(|x|,ilogb(x)-23) */
|
||||
GET_LOW_WORD(low,x);
|
||||
SET_LOW_WORD(z,low);
|
||||
e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */
|
||||
SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20)));
|
||||
INSERT_WORDS(z, ix - ((int32_t)(e0<<20)), low);
|
||||
for(i=0;i<2;i++) {
|
||||
tx[i] = (double)((int32_t)(z));
|
||||
z = (z-tx[i])*two24;
|
||||
|
@ -362,7 +362,7 @@ gpart_autofill_resize(struct gctl_req *req)
|
||||
goto done;
|
||||
}
|
||||
|
||||
offset = pp->lg_stripeoffset / pp->lg_sectorsize;
|
||||
offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment;
|
||||
last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0);
|
||||
LIST_FOREACH(pp, &gp->lg_provider, lg_provider) {
|
||||
s = find_provcfg(pp, "index");
|
||||
@ -497,10 +497,10 @@ gpart_autofill(struct gctl_req *req)
|
||||
alignment = len;
|
||||
|
||||
/* Adjust parameters to stripeoffset */
|
||||
offset = pp->lg_stripeoffset / pp->lg_sectorsize;
|
||||
offset = (pp->lg_stripeoffset / pp->lg_sectorsize) % alignment;
|
||||
start = ALIGNUP(start + offset, alignment);
|
||||
if (size + offset > alignment)
|
||||
size = ALIGNDOWN(size + offset, alignment);
|
||||
if (size > alignment)
|
||||
size = ALIGNDOWN(size, alignment);
|
||||
|
||||
first = (off_t)strtoimax(find_geomcfg(gp, "first"), NULL, 0);
|
||||
last = (off_t)strtoimax(find_geomcfg(gp, "last"), NULL, 0);
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 18, 2011
|
||||
.Dd June 19, 2011
|
||||
.Dt RC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -4293,6 +4293,61 @@ Bus address of the USB Bluetooth controller.
|
||||
Check the output of
|
||||
.Xr usbconfig 8
|
||||
on your system to find this information.
|
||||
.It Va netwait_enable
|
||||
.Pq Vt bool
|
||||
If set to
|
||||
.Dq Li YES ,
|
||||
delays the start of network-reliant services until
|
||||
.Va netwait_if
|
||||
is up and ICMP packets to a destination defined in
|
||||
.Va netwait_ip
|
||||
are flowing.
|
||||
Link state is examined first, followed by
|
||||
.Dq Li pinging
|
||||
an IP address to verify network usability.
|
||||
If no destination can be reached or timeouts are exceeded,
|
||||
network services are started anyway with no guarantee that
|
||||
the network is usable.
|
||||
Use of this variable requires both
|
||||
.Va netwait_ip
|
||||
and
|
||||
.Va netwait_if
|
||||
to be set.
|
||||
.It Va netwait_ip
|
||||
.Pq Vt str
|
||||
Empty by default.
|
||||
This variable contains a space-delimited list of IP addresses to
|
||||
.Xr ping 8 .
|
||||
DNS hostnames should not be used as resolution is not guaranteed
|
||||
to be functional at this point.
|
||||
If multiple IP addresses are specified,
|
||||
each will be tried until one is successful or the list is exhausted.
|
||||
.It Va netwait_timeout
|
||||
.Pq Vt int
|
||||
Indicates the total number of seconds to perform a
|
||||
.Dq Li ping
|
||||
against each IP address in
|
||||
.Va netwait_ip ,
|
||||
at a rate of one ping per second.
|
||||
If any of the pings are successful,
|
||||
full network connectivity is considered reliable.
|
||||
The default is 60.
|
||||
.It Va netwait_if
|
||||
.Pq Vt str
|
||||
Empty by default.
|
||||
Defines the name of the network interface on which watch for link.
|
||||
.Xr ifconfig 8
|
||||
is used to monitor the interface, looking for
|
||||
.Dq Li status: no carrier .
|
||||
Once gone, the link is considered up.
|
||||
This can be a
|
||||
.Xr vlan 4
|
||||
interface if desired.
|
||||
.It Va netwait_if_timeout
|
||||
.Pq Vt int
|
||||
Defines the total number of seconds to wait for link to become usable,
|
||||
polled at a 1-second interval.
|
||||
The default is 30.
|
||||
.El
|
||||
.Sh FILES
|
||||
.Bl -tag -width ".Pa /etc/defaults/rc.conf" -compact
|
||||
@ -4364,6 +4419,7 @@ on your system to find this information.
|
||||
.Xr ntpdate 8 ,
|
||||
.Xr pfctl 8 ,
|
||||
.Xr pflogd 8 ,
|
||||
.Xr ping 8 ,
|
||||
.Xr powerd 8 ,
|
||||
.Xr quotacheck 8 ,
|
||||
.Xr quotaon 8 ,
|
||||
|
@ -203,11 +203,13 @@ powerpc/powerpc/syncicache.c standard
|
||||
powerpc/powerpc/sys_machdep.c standard
|
||||
powerpc/powerpc/uio_machdep.c standard
|
||||
powerpc/ps3/ehci_ps3.c optional ps3 ehci
|
||||
powerpc/ps3/ohci_ps3.c optional ps3 ohci
|
||||
powerpc/ps3/if_glc.c optional ps3 glc
|
||||
powerpc/ps3/mmu_ps3.c optional ps3
|
||||
powerpc/ps3/platform_ps3.c optional ps3
|
||||
powerpc/ps3/ps3ata.c optional ps3 ps3ata
|
||||
powerpc/ps3/ps3bus.c optional ps3
|
||||
powerpc/ps3/ps3disk.c optional ps3
|
||||
powerpc/ps3/ps3pic.c optional ps3
|
||||
powerpc/ps3/ps3_syscons.c optional ps3 sc
|
||||
powerpc/ps3/ps3-hvcall.S optional ps3 sc
|
||||
|
@ -1100,7 +1100,7 @@ get_typematic(keyboard_t *kbd)
|
||||
/*
|
||||
* Traditional entry points of int 0x15 and 0x16 are fixed
|
||||
* and later BIOSes follow them. (U)EFI CSM specification
|
||||
* also mandate these fixed entry points.
|
||||
* also mandates these fixed entry points.
|
||||
*
|
||||
* Validate the entry points here before we proceed further.
|
||||
* It's known that some recent laptops does not have the
|
||||
|
@ -36,6 +36,7 @@
|
||||
#ifdef HAVE_KERNEL_OPTION_HEADERS
|
||||
#include "opt_device_polling.h"
|
||||
#include "opt_inet.h"
|
||||
#include "opt_inet6.h"
|
||||
#include "opt_altq.h"
|
||||
#endif
|
||||
|
||||
@ -99,7 +100,7 @@ int igb_display_debug_stats = 0;
|
||||
/*********************************************************************
|
||||
* Driver version:
|
||||
*********************************************************************/
|
||||
char igb_driver_version[] = "version - 2.2.3";
|
||||
char igb_driver_version[] = "version - 2.2.5";
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
@ -265,6 +266,7 @@ static void igb_handle_link(void *context, int pending);
|
||||
static void igb_set_sysctl_value(struct adapter *, const char *,
|
||||
const char *, int *, int);
|
||||
static int igb_set_flowcntl(SYSCTL_HANDLER_ARGS);
|
||||
static int igb_sysctl_dmac(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
#ifdef DEVICE_POLLING
|
||||
static poll_handler_t igb_poll;
|
||||
@ -344,25 +346,6 @@ TUNABLE_INT("hw.igb.hdr_split", &igb_header_split);
|
||||
static int igb_num_queues = 0;
|
||||
TUNABLE_INT("hw.igb.num_queues", &igb_num_queues);
|
||||
|
||||
/* How many packets rxeof tries to clean at a time */
|
||||
static int igb_rx_process_limit = 100;
|
||||
TUNABLE_INT("hw.igb.rx_process_limit", &igb_rx_process_limit);
|
||||
|
||||
/* Flow control setting - default to FULL */
|
||||
static int igb_fc_setting = e1000_fc_full;
|
||||
TUNABLE_INT("hw.igb.fc_setting", &igb_fc_setting);
|
||||
|
||||
/* Energy Efficient Ethernet - default to off */
|
||||
static int igb_eee_disabled = TRUE;
|
||||
TUNABLE_INT("hw.igb.eee_disabled", &igb_eee_disabled);
|
||||
|
||||
/*
|
||||
** DMA Coalescing, only for i350 - default to off,
|
||||
** this feature is for power savings
|
||||
*/
|
||||
static int igb_dma_coalesce = FALSE;
|
||||
TUNABLE_INT("hw.igb.dma_coalesce", &igb_dma_coalesce);
|
||||
|
||||
/*********************************************************************
|
||||
* Device identification routine
|
||||
*
|
||||
@ -433,6 +416,11 @@ igb_attach(device_t dev)
|
||||
|
||||
INIT_DEBUGOUT("igb_attach: begin");
|
||||
|
||||
if (resource_disabled("igb", device_get_unit(dev))) {
|
||||
device_printf(dev, "Disabled by device hint\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
adapter = device_get_softc(dev);
|
||||
adapter->dev = adapter->osdep.dev = dev;
|
||||
IGB_CORE_LOCK_INIT(adapter, device_get_nameunit(dev));
|
||||
@ -450,7 +438,7 @@ igb_attach(device_t dev)
|
||||
|
||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
|
||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
|
||||
OID_AUTO, "flow_control", CTLTYPE_INT|CTLFLAG_RW,
|
||||
OID_AUTO, "fc", CTLTYPE_INT|CTLFLAG_RW,
|
||||
adapter, 0, igb_set_flowcntl, "I", "Flow Control");
|
||||
|
||||
callout_init_mtx(&adapter->timer, &adapter->core_mtx, 0);
|
||||
@ -476,8 +464,8 @@ igb_attach(device_t dev)
|
||||
|
||||
/* Sysctl for limiting the amount of work done in the taskqueue */
|
||||
igb_set_sysctl_value(adapter, "rx_processing_limit",
|
||||
"max number of rx packets to process", &adapter->rx_process_limit,
|
||||
igb_rx_process_limit);
|
||||
"max number of rx packets to process",
|
||||
&adapter->rx_process_limit, 100);
|
||||
|
||||
/*
|
||||
* Validate number of transmit and receive descriptors. It
|
||||
@ -552,13 +540,14 @@ igb_attach(device_t dev)
|
||||
|
||||
/* Some adapter-specific advanced features */
|
||||
if (adapter->hw.mac.type >= e1000_i350) {
|
||||
igb_set_sysctl_value(adapter, "dma_coalesce",
|
||||
"configure dma coalesce",
|
||||
&adapter->dma_coalesce, igb_dma_coalesce);
|
||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
|
||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
|
||||
OID_AUTO, "dmac", CTLTYPE_INT|CTLFLAG_RW,
|
||||
adapter, 0, igb_sysctl_dmac, "I", "DMA Coalesce");
|
||||
igb_set_sysctl_value(adapter, "eee_disabled",
|
||||
"enable Energy Efficient Ethernet",
|
||||
&adapter->hw.dev_spec._82575.eee_disable,
|
||||
igb_eee_disabled);
|
||||
TRUE);
|
||||
e1000_set_eee_i350(&adapter->hw);
|
||||
}
|
||||
|
||||
@ -658,6 +647,7 @@ igb_attach(device_t dev)
|
||||
return (0);
|
||||
|
||||
err_late:
|
||||
igb_detach(dev);
|
||||
igb_free_transmit_structures(adapter);
|
||||
igb_free_receive_structures(adapter);
|
||||
igb_release_hw_control(adapter);
|
||||
@ -736,7 +726,8 @@ igb_detach(device_t dev)
|
||||
|
||||
igb_free_transmit_structures(adapter);
|
||||
igb_free_receive_structures(adapter);
|
||||
free(adapter->mta, M_DEVBUF);
|
||||
if (adapter->mta != NULL)
|
||||
free(adapter->mta, M_DEVBUF);
|
||||
|
||||
IGB_CORE_LOCK_DESTROY(adapter);
|
||||
|
||||
@ -1025,11 +1016,12 @@ static int
|
||||
igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
{
|
||||
struct adapter *adapter = ifp->if_softc;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
#ifdef INET
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
#if defined(INET) || defined(INET6)
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
bool avoid_reset = FALSE;
|
||||
#endif
|
||||
int error = 0;
|
||||
int error = 0;
|
||||
|
||||
if (adapter->in_detach)
|
||||
return (error);
|
||||
@ -1037,20 +1029,22 @@ igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
switch (command) {
|
||||
case SIOCSIFADDR:
|
||||
#ifdef INET
|
||||
if (ifa->ifa_addr->sa_family == AF_INET) {
|
||||
/*
|
||||
* XXX
|
||||
* Since resetting hardware takes a very long time
|
||||
* and results in link renegotiation we only
|
||||
* initialize the hardware only when it is absolutely
|
||||
* required.
|
||||
*/
|
||||
if (ifa->ifa_addr->sa_family == AF_INET)
|
||||
avoid_reset = TRUE;
|
||||
#endif
|
||||
#ifdef INET6
|
||||
if (ifa->ifa_addr->sa_family == AF_INET6)
|
||||
avoid_reset = TRUE;
|
||||
#endif
|
||||
#if defined(INET) || defined(INET6)
|
||||
/*
|
||||
** Calling init results in link renegotiation,
|
||||
** so we avoid doing it when possible.
|
||||
*/
|
||||
if (avoid_reset) {
|
||||
ifp->if_flags |= IFF_UP;
|
||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
|
||||
IGB_CORE_LOCK(adapter);
|
||||
igb_init_locked(adapter);
|
||||
IGB_CORE_UNLOCK(adapter);
|
||||
}
|
||||
if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
|
||||
igb_init(adapter);
|
||||
if (!(ifp->if_flags & IFF_NOARP))
|
||||
arp_ifinit(ifp, ifa);
|
||||
} else
|
||||
@ -1175,6 +1169,10 @@ igb_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
ifp->if_capenable ^= IFCAP_VLAN_HWFILTER;
|
||||
reinit = 1;
|
||||
}
|
||||
if (mask & IFCAP_VLAN_HWTSO) {
|
||||
ifp->if_capenable ^= IFCAP_VLAN_HWTSO;
|
||||
reinit = 1;
|
||||
}
|
||||
if (mask & IFCAP_LRO) {
|
||||
ifp->if_capenable ^= IFCAP_LRO;
|
||||
reinit = 1;
|
||||
@ -2721,6 +2719,12 @@ igb_reset(struct adapter *adapter)
|
||||
|
||||
fc->pause_time = IGB_FC_PAUSE_TIME;
|
||||
fc->send_xon = TRUE;
|
||||
if (fc->requested_mode)
|
||||
fc->current_mode = fc->requested_mode;
|
||||
else
|
||||
fc->current_mode = e1000_fc_full;
|
||||
|
||||
adapter->fc = fc->current_mode;
|
||||
|
||||
/* Issue a global reset */
|
||||
e1000_reset_hw(hw);
|
||||
@ -2730,9 +2734,13 @@ igb_reset(struct adapter *adapter)
|
||||
device_printf(dev, "Hardware Initialization Failed\n");
|
||||
|
||||
/* Setup DMA Coalescing */
|
||||
if ((hw->mac.type == e1000_i350) &&
|
||||
(adapter->dma_coalesce == TRUE)) {
|
||||
u32 reg;
|
||||
if (hw->mac.type == e1000_i350) {
|
||||
u32 reg = ~E1000_DMACR_DMAC_EN;
|
||||
|
||||
if (adapter->dmac == 0) { /* Disabling it */
|
||||
E1000_WRITE_REG(hw, E1000_DMACR, reg);
|
||||
goto reset_out;
|
||||
}
|
||||
|
||||
hwm = (pba - 4) << 10;
|
||||
reg = (((pba-6) << E1000_DMACR_DMACTHR_SHIFT)
|
||||
@ -2741,8 +2749,8 @@ igb_reset(struct adapter *adapter)
|
||||
/* transition to L0x or L1 if available..*/
|
||||
reg |= (E1000_DMACR_DMAC_EN | E1000_DMACR_DMAC_LX_MASK);
|
||||
|
||||
/* timer = +-1000 usec in 32usec intervals */
|
||||
reg |= (1000 >> 5);
|
||||
/* timer = value in adapter->dmac in 32usec intervals */
|
||||
reg |= (adapter->dmac >> 5);
|
||||
E1000_WRITE_REG(hw, E1000_DMACR, reg);
|
||||
|
||||
/* No lower threshold */
|
||||
@ -2767,6 +2775,7 @@ igb_reset(struct adapter *adapter)
|
||||
device_printf(dev, "DMA Coalescing enabled\n");
|
||||
}
|
||||
|
||||
reset_out:
|
||||
E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN);
|
||||
e1000_get_phy_info(hw);
|
||||
e1000_check_for_link(hw);
|
||||
@ -2827,15 +2836,19 @@ igb_setup_interface(device_t dev, struct adapter *adapter)
|
||||
* support full VLAN capability.
|
||||
*/
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
|
||||
ifp->if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU;
|
||||
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING
|
||||
| IFCAP_VLAN_HWTSO
|
||||
| IFCAP_VLAN_MTU;
|
||||
ifp->if_capenable |= IFCAP_VLAN_HWTAGGING
|
||||
| IFCAP_VLAN_HWTSO
|
||||
| IFCAP_VLAN_MTU;
|
||||
|
||||
/*
|
||||
** Dont turn this on by default, if vlans are
|
||||
** Don't turn this on by default, if vlans are
|
||||
** created on another pseudo device (eg. lagg)
|
||||
** then vlan events are not passed thru, breaking
|
||||
** operation, but with HW FILTER off it works. If
|
||||
** using vlans directly on the em driver you can
|
||||
** using vlans directly on the igb driver you can
|
||||
** enable this and get full hardware tag filtering.
|
||||
*/
|
||||
ifp->if_capabilities |= IFCAP_VLAN_HWFILTER;
|
||||
@ -5595,19 +5608,18 @@ static int
|
||||
igb_set_flowcntl(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
int error;
|
||||
struct adapter *adapter;
|
||||
struct adapter *adapter = (struct adapter *) arg1;
|
||||
|
||||
error = sysctl_handle_int(oidp, &igb_fc_setting, 0, req);
|
||||
error = sysctl_handle_int(oidp, &adapter->fc, 0, req);
|
||||
|
||||
if (error)
|
||||
if ((error) || (req->newptr == NULL))
|
||||
return (error);
|
||||
|
||||
adapter = (struct adapter *) arg1;
|
||||
switch (igb_fc_setting) {
|
||||
switch (adapter->fc) {
|
||||
case e1000_fc_rx_pause:
|
||||
case e1000_fc_tx_pause:
|
||||
case e1000_fc_full:
|
||||
adapter->hw.fc.requested_mode = igb_fc_setting;
|
||||
adapter->hw.fc.requested_mode = adapter->fc;
|
||||
break;
|
||||
case e1000_fc_none:
|
||||
default:
|
||||
@ -5616,5 +5628,54 @@ igb_set_flowcntl(SYSCTL_HANDLER_ARGS)
|
||||
|
||||
adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode;
|
||||
e1000_force_mac_fc(&adapter->hw);
|
||||
return error;
|
||||
return (error);
|
||||
}
|
||||
|
||||
/*
|
||||
** Manage DMA Coalesce:
|
||||
** Control values:
|
||||
** 0/1 - off/on
|
||||
** Legal timer values are:
|
||||
** 250,500,1000-10000 in thousands
|
||||
*/
|
||||
static int
|
||||
igb_sysctl_dmac(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct adapter *adapter = (struct adapter *) arg1;
|
||||
int error;
|
||||
|
||||
error = sysctl_handle_int(oidp, &adapter->dmac, 0, req);
|
||||
|
||||
if ((error) || (req->newptr == NULL))
|
||||
return (error);
|
||||
|
||||
switch (adapter->dmac) {
|
||||
case 0:
|
||||
/*Disabling */
|
||||
break;
|
||||
case 1: /* Just enable and use default */
|
||||
adapter->dmac = 1000;
|
||||
break;
|
||||
case 250:
|
||||
case 500:
|
||||
case 1000:
|
||||
case 2000:
|
||||
case 3000:
|
||||
case 4000:
|
||||
case 5000:
|
||||
case 6000:
|
||||
case 7000:
|
||||
case 8000:
|
||||
case 9000:
|
||||
case 10000:
|
||||
/* Legal values - allow */
|
||||
break;
|
||||
default:
|
||||
/* Do nothing, illegal value */
|
||||
adapter->dmac = 0;
|
||||
return (error);
|
||||
}
|
||||
/* Reinit the interface */
|
||||
igb_init(adapter);
|
||||
return (error);
|
||||
}
|
||||
|
@ -396,11 +396,12 @@ struct adapter {
|
||||
u32 shadow_vfta[IGB_VFTA_SIZE];
|
||||
|
||||
/* Info about the interface */
|
||||
u8 link_active;
|
||||
u16 link_active;
|
||||
u16 fc;
|
||||
u16 link_speed;
|
||||
u16 link_duplex;
|
||||
u32 smartspeed;
|
||||
u32 dma_coalesce;
|
||||
u32 dmac;
|
||||
|
||||
/* Interface queues */
|
||||
struct igb_queue *queues;
|
||||
|
@ -2072,8 +2072,9 @@ fwohci_check_stat(struct fwohci_softc *sc)
|
||||
FW_GLOCK_ASSERT(&sc->fc);
|
||||
stat = OREAD(sc, FWOHCI_INTSTAT);
|
||||
if (stat == 0xffffffff) {
|
||||
device_printf(sc->fc.dev,
|
||||
"device physically ejected?\n");
|
||||
if (!bus_child_present(sc->fc.dev))
|
||||
return (FILTER_HANDLED);
|
||||
device_printf(sc->fc.dev, "device physically ejected?\n");
|
||||
return (FILTER_STRAY);
|
||||
}
|
||||
if (stat)
|
||||
|
@ -657,6 +657,12 @@ cbb_pci_shutdown(device_t brdev)
|
||||
{
|
||||
struct cbb_softc *sc = (struct cbb_softc *)device_get_softc(brdev);
|
||||
|
||||
/*
|
||||
* We're about to pull the rug out from the card, so mark it as
|
||||
* gone to prevent harm.
|
||||
*/
|
||||
sc->cardok = 0;
|
||||
|
||||
/*
|
||||
* Place the cards in reset, turn off the interrupts and power
|
||||
* down the socket.
|
||||
|
@ -323,9 +323,7 @@ newnfs_disconnect(struct nfssockreq *nrp)
|
||||
client = nrp->nr_client;
|
||||
nrp->nr_client = NULL;
|
||||
mtx_unlock(&nrp->nr_mtx);
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_secpurge(client);
|
||||
#endif
|
||||
rpc_gss_secpurge_call(client);
|
||||
CLNT_CLOSE(client);
|
||||
CLNT_RELEASE(client);
|
||||
} else {
|
||||
@ -337,21 +335,18 @@ static AUTH *
|
||||
nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
|
||||
char *srv_principal, gss_OID mech_oid, struct ucred *cred)
|
||||
{
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_service_t svc;
|
||||
AUTH *auth;
|
||||
#ifdef notyet
|
||||
rpc_gss_options_req_t req_options;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
switch (secflavour) {
|
||||
#ifdef KGSSAPI
|
||||
case RPCSEC_GSS_KRB5:
|
||||
case RPCSEC_GSS_KRB5I:
|
||||
case RPCSEC_GSS_KRB5P:
|
||||
if (!mech_oid) {
|
||||
if (!rpc_gss_mech_to_oid("kerberosv5", &mech_oid))
|
||||
if (!rpc_gss_mech_to_oid_call("kerberosv5", &mech_oid))
|
||||
return (NULL);
|
||||
}
|
||||
if (secflavour == RPCSEC_GSS_KRB5)
|
||||
@ -367,7 +362,7 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
|
||||
req_options.input_channel_bindings = NULL;
|
||||
req_options.enc_type = nfs_keytab_enctype;
|
||||
|
||||
auth = rpc_gss_secfind(nrp->nr_client, cred,
|
||||
auth = rpc_gss_secfind_call(nrp->nr_client, cred,
|
||||
clnt_principal, srv_principal, mech_oid, svc,
|
||||
&req_options);
|
||||
#else
|
||||
@ -377,7 +372,7 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
|
||||
* principals. As such, that case cannot yet be handled.
|
||||
*/
|
||||
if (clnt_principal == NULL)
|
||||
auth = rpc_gss_secfind(nrp->nr_client, cred,
|
||||
auth = rpc_gss_secfind_call(nrp->nr_client, cred,
|
||||
srv_principal, mech_oid, svc);
|
||||
else
|
||||
auth = NULL;
|
||||
@ -385,7 +380,6 @@ nfs_getauth(struct nfssockreq *nrp, int secflavour, char *clnt_principal,
|
||||
if (auth != NULL)
|
||||
return (auth);
|
||||
/* fallthrough */
|
||||
#endif /* KGSSAPI */
|
||||
case AUTH_SYS:
|
||||
default:
|
||||
return (authunix_create(cred));
|
||||
|
@ -215,12 +215,9 @@ nfscbd_addsock(struct file *fp)
|
||||
int
|
||||
nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args)
|
||||
{
|
||||
#ifdef KGSSAPI
|
||||
char principal[128];
|
||||
int error;
|
||||
#endif
|
||||
|
||||
#ifdef KGSSAPI
|
||||
if (args != NULL) {
|
||||
error = copyinstr(args->principal, principal,
|
||||
sizeof(principal), NULL);
|
||||
@ -229,7 +226,6 @@ nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args)
|
||||
} else {
|
||||
principal[0] = '\0';
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Only the first nfsd actually does any work. The RPC code
|
||||
@ -244,20 +240,16 @@ nfscbd_nfsd(struct thread *td, struct nfsd_nfscbd_args *args)
|
||||
|
||||
NFSD_UNLOCK();
|
||||
|
||||
#ifdef KGSSAPI
|
||||
if (principal[0] != '\0')
|
||||
rpc_gss_set_svc_name(principal, "kerberosv5",
|
||||
rpc_gss_set_svc_name_call(principal, "kerberosv5",
|
||||
GSS_C_INDEFINITE, NFS_CALLBCKPROG, NFSV4_CBVERS);
|
||||
#endif
|
||||
|
||||
nfscbd_pool->sp_minthreads = 4;
|
||||
nfscbd_pool->sp_maxthreads = 4;
|
||||
|
||||
svc_run(nfscbd_pool);
|
||||
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_clear_svc_name(NFS_CALLBCKPROG, NFSV4_CBVERS);
|
||||
#endif
|
||||
rpc_gss_clear_svc_name_call(NFS_CALLBCKPROG, NFSV4_CBVERS);
|
||||
|
||||
NFSD_LOCK();
|
||||
nfs_numnfscbd--;
|
||||
|
@ -405,6 +405,7 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so)
|
||||
{
|
||||
struct nfsrvcache *rp;
|
||||
struct nfsrvcache *retrp = NULL;
|
||||
mbuf_t m;
|
||||
|
||||
rp = nd->nd_rp;
|
||||
if (!rp)
|
||||
@ -457,9 +458,9 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so)
|
||||
}
|
||||
if ((nd->nd_flag & ND_NFSV2) &&
|
||||
nfsv2_repstat[newnfsv2_procid[nd->nd_procnum]]) {
|
||||
NFSUNLOCKCACHE();
|
||||
rp->rc_status = nd->nd_repstat;
|
||||
rp->rc_flag |= RC_REPSTATUS;
|
||||
NFSUNLOCKCACHE();
|
||||
} else {
|
||||
if (!(rp->rc_flag & RC_UDP)) {
|
||||
nfsrc_tcpsavedreplies++;
|
||||
@ -469,9 +470,11 @@ nfsrvd_updatecache(struct nfsrv_descript *nd, struct socket *so)
|
||||
nfsrc_tcpsavedreplies;
|
||||
}
|
||||
NFSUNLOCKCACHE();
|
||||
rp->rc_reply = m_copym(nd->nd_mreq, 0, M_COPYALL,
|
||||
M_WAIT);
|
||||
m = m_copym(nd->nd_mreq, 0, M_COPYALL, M_WAIT);
|
||||
NFSLOCKCACHE();
|
||||
rp->rc_reply = m;
|
||||
rp->rc_flag |= RC_REPMBUF;
|
||||
NFSUNLOCKCACHE();
|
||||
}
|
||||
if (rp->rc_flag & RC_UDP) {
|
||||
rp->rc_timestamp = NFSD_MONOSEC +
|
||||
@ -518,6 +521,7 @@ nfsrvd_delcache(struct nfsrvcache *rp)
|
||||
APPLESTATIC void
|
||||
nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err)
|
||||
{
|
||||
tcp_seq tmp_seq;
|
||||
|
||||
if (!(rp->rc_flag & RC_LOCKED))
|
||||
panic("nfsrvd_sentcache not locked");
|
||||
@ -526,8 +530,12 @@ nfsrvd_sentcache(struct nfsrvcache *rp, struct socket *so, int err)
|
||||
so->so_proto->pr_domain->dom_family != AF_INET6) ||
|
||||
so->so_proto->pr_protocol != IPPROTO_TCP)
|
||||
panic("nfs sent cache");
|
||||
if (nfsrv_getsockseqnum(so, &rp->rc_tcpseq))
|
||||
if (nfsrv_getsockseqnum(so, &tmp_seq)) {
|
||||
NFSLOCKCACHE();
|
||||
rp->rc_tcpseq = tmp_seq;
|
||||
rp->rc_flag |= RC_TCPSEQ;
|
||||
NFSUNLOCKCACHE();
|
||||
}
|
||||
}
|
||||
nfsrc_unlock(rp);
|
||||
}
|
||||
@ -687,8 +695,11 @@ nfsrc_lock(struct nfsrvcache *rp)
|
||||
static void
|
||||
nfsrc_unlock(struct nfsrvcache *rp)
|
||||
{
|
||||
|
||||
NFSLOCKCACHE();
|
||||
rp->rc_flag &= ~RC_LOCKED;
|
||||
nfsrc_wanted(rp);
|
||||
NFSUNLOCKCACHE();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -386,18 +386,14 @@ nfsrvd_addsock(struct file *fp)
|
||||
int
|
||||
nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
|
||||
{
|
||||
#ifdef KGSSAPI
|
||||
char principal[MAXHOSTNAMELEN + 5];
|
||||
int error;
|
||||
bool_t ret2, ret3, ret4;
|
||||
#endif
|
||||
|
||||
#ifdef KGSSAPI
|
||||
error = copyinstr(args->principal, principal, sizeof (principal),
|
||||
NULL);
|
||||
if (error)
|
||||
return (error);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Only the first nfsd actually does any work. The RPC code
|
||||
@ -412,38 +408,29 @@ nfsrvd_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
|
||||
|
||||
NFSD_UNLOCK();
|
||||
|
||||
#ifdef KGSSAPI
|
||||
/* An empty string implies AUTH_SYS only. */
|
||||
if (principal[0] != '\0') {
|
||||
ret2 = rpc_gss_set_svc_name(principal, "kerberosv5",
|
||||
GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);
|
||||
ret3 = rpc_gss_set_svc_name(principal, "kerberosv5",
|
||||
GSS_C_INDEFINITE, NFS_PROG, NFS_VER3);
|
||||
ret4 = rpc_gss_set_svc_name(principal, "kerberosv5",
|
||||
GSS_C_INDEFINITE, NFS_PROG, NFS_VER4);
|
||||
ret2 = rpc_gss_set_svc_name_call(principal,
|
||||
"kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);
|
||||
ret3 = rpc_gss_set_svc_name_call(principal,
|
||||
"kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER3);
|
||||
ret4 = rpc_gss_set_svc_name_call(principal,
|
||||
"kerberosv5", GSS_C_INDEFINITE, NFS_PROG, NFS_VER4);
|
||||
|
||||
if (!ret2 || !ret3 || !ret4) {
|
||||
NFSD_LOCK();
|
||||
newnfs_numnfsd--;
|
||||
nfsrvd_init(1);
|
||||
NFSD_UNLOCK();
|
||||
return (EAUTH);
|
||||
}
|
||||
if (!ret2 || !ret3 || !ret4)
|
||||
printf("nfsd: can't register svc name\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
nfsrvd_pool->sp_minthreads = args->minthreads;
|
||||
nfsrvd_pool->sp_maxthreads = args->maxthreads;
|
||||
|
||||
svc_run(nfsrvd_pool);
|
||||
|
||||
#ifdef KGSSAPI
|
||||
if (principal[0] != '\0') {
|
||||
rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2);
|
||||
rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3);
|
||||
rpc_gss_clear_svc_name(NFS_PROG, NFS_VER4);
|
||||
rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2);
|
||||
rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3);
|
||||
rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER4);
|
||||
}
|
||||
#endif
|
||||
|
||||
NFSD_LOCK();
|
||||
newnfs_numnfsd--;
|
||||
|
@ -454,7 +454,7 @@ nfsmout:
|
||||
APPLESTATIC int
|
||||
nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
vnode_t dp, vnode_t *vpp, fhandle_t *fhp, NFSPROC_T *p,
|
||||
__unused struct nfsexstuff *exp)
|
||||
struct nfsexstuff *exp)
|
||||
{
|
||||
struct nameidata named;
|
||||
vnode_t vp, dirp = NULL;
|
||||
@ -508,7 +508,15 @@ nfsrvd_lookup(struct nfsrv_descript *nd, __unused int isdgram,
|
||||
vrele(named.ni_startdir);
|
||||
nfsvno_relpathbuf(&named);
|
||||
vp = named.ni_vp;
|
||||
nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
|
||||
if ((nd->nd_flag & ND_NFSV4) != 0 && !NFSVNO_EXPORTED(exp) &&
|
||||
vp->v_type != VDIR && vp->v_type != VLNK)
|
||||
/*
|
||||
* Only allow lookup of VDIR and VLNK for traversal of
|
||||
* non-exported volumes during NFSv4 mounting.
|
||||
*/
|
||||
nd->nd_repstat = ENOENT;
|
||||
if (nd->nd_repstat == 0)
|
||||
nd->nd_repstat = nfsvno_getfh(vp, fhp, p);
|
||||
if (!(nd->nd_flag & ND_NFSV4) && !nd->nd_repstat)
|
||||
nd->nd_repstat = nfsvno_getattr(vp, &nva, nd->nd_cred, p, 1);
|
||||
if (vpp != NULL && nd->nd_repstat == 0)
|
||||
|
@ -786,6 +786,8 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram,
|
||||
op != NFSV4OP_LOOKUP &&
|
||||
op != NFSV4OP_GETATTR &&
|
||||
op != NFSV4OP_GETFH &&
|
||||
op != NFSV4OP_ACCESS &&
|
||||
op != NFSV4OP_READLINK &&
|
||||
op != NFSV4OP_SECINFO)
|
||||
nd->nd_repstat = NFSERR_NOFILEHANDLE;
|
||||
else if (nfsvno_testexp(nd, &vpnes) &&
|
||||
|
@ -46,6 +46,11 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "g_part_if.h"
|
||||
|
||||
#define BOOT1_SIZE 512
|
||||
#define LABEL_SIZE 512
|
||||
#define BOOT2_OFF (BOOT1_SIZE + LABEL_SIZE)
|
||||
#define BOOT2_SIZE (BBSIZE - BOOT2_OFF)
|
||||
|
||||
FEATURE(geom_part_bsd, "GEOM partitioning class for BSD disklabels");
|
||||
|
||||
struct g_part_bsd_table {
|
||||
@ -170,22 +175,16 @@ g_part_bsd_bootcode(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
{
|
||||
struct g_part_bsd_table *table;
|
||||
const u_char *codeptr;
|
||||
size_t hdsz, tlsz;
|
||||
size_t codesz, tlofs;
|
||||
|
||||
hdsz = 512;
|
||||
tlofs = hdsz + 148 + basetable->gpt_entries * 16;
|
||||
tlsz = BBSIZE - tlofs;
|
||||
if (gpp->gpp_codesize != BOOT1_SIZE && gpp->gpp_codesize != BBSIZE)
|
||||
return (ENODEV);
|
||||
|
||||
table = (struct g_part_bsd_table *)basetable;
|
||||
bzero(table->bbarea, hdsz);
|
||||
bzero(table->bbarea + tlofs, tlsz);
|
||||
codeptr = gpp->gpp_codeptr;
|
||||
codesz = MIN(hdsz, gpp->gpp_codesize);
|
||||
if (codesz > 0)
|
||||
bcopy(codeptr, table->bbarea, codesz);
|
||||
codesz = MIN(tlsz, gpp->gpp_codesize - tlofs);
|
||||
if (codesz > 0)
|
||||
bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz);
|
||||
bcopy(codeptr, table->bbarea, BOOT1_SIZE);
|
||||
if (gpp->gpp_codesize == BBSIZE)
|
||||
bcopy(codeptr + BOOT2_OFF, table->bbarea + BOOT2_OFF,
|
||||
BOOT2_SIZE);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <kgssapi/gssapi_impl.h>
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/rpc_com.h>
|
||||
#include <rpc/rpcsec_gss.h>
|
||||
|
||||
#include "gssd.h"
|
||||
#include "kgss_if.h"
|
||||
@ -253,8 +254,40 @@ kgss_copy_buffer(const gss_buffer_t from, gss_buffer_t to)
|
||||
static int
|
||||
kgssapi_modevent(module_t mod, int type, void *data)
|
||||
{
|
||||
int error = 0;
|
||||
|
||||
return (0);
|
||||
switch (type) {
|
||||
case MOD_LOAD:
|
||||
rpc_gss_entries.rpc_gss_secfind = rpc_gss_secfind;
|
||||
rpc_gss_entries.rpc_gss_secpurge = rpc_gss_secpurge;
|
||||
rpc_gss_entries.rpc_gss_seccreate = rpc_gss_seccreate;
|
||||
rpc_gss_entries.rpc_gss_set_defaults = rpc_gss_set_defaults;
|
||||
rpc_gss_entries.rpc_gss_max_data_length =
|
||||
rpc_gss_max_data_length;
|
||||
rpc_gss_entries.rpc_gss_get_error = rpc_gss_get_error;
|
||||
rpc_gss_entries.rpc_gss_mech_to_oid = rpc_gss_mech_to_oid;
|
||||
rpc_gss_entries.rpc_gss_oid_to_mech = rpc_gss_oid_to_mech;
|
||||
rpc_gss_entries.rpc_gss_qop_to_num = rpc_gss_qop_to_num;
|
||||
rpc_gss_entries.rpc_gss_get_mechanisms = rpc_gss_get_mechanisms;
|
||||
rpc_gss_entries.rpc_gss_get_versions = rpc_gss_get_versions;
|
||||
rpc_gss_entries.rpc_gss_is_installed = rpc_gss_is_installed;
|
||||
rpc_gss_entries.rpc_gss_set_svc_name = rpc_gss_set_svc_name;
|
||||
rpc_gss_entries.rpc_gss_clear_svc_name = rpc_gss_clear_svc_name;
|
||||
rpc_gss_entries.rpc_gss_getcred = rpc_gss_getcred;
|
||||
rpc_gss_entries.rpc_gss_set_callback = rpc_gss_set_callback;
|
||||
rpc_gss_entries.rpc_gss_clear_callback = rpc_gss_clear_callback;
|
||||
rpc_gss_entries.rpc_gss_get_principal_name =
|
||||
rpc_gss_get_principal_name;
|
||||
rpc_gss_entries.rpc_gss_svc_max_data_length =
|
||||
rpc_gss_svc_max_data_length;
|
||||
break;
|
||||
case MOD_UNLOAD:
|
||||
/* Unloading of the kgssapi module isn't supported. */
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
error = EOPNOTSUPP;
|
||||
};
|
||||
return (error);
|
||||
}
|
||||
static moduledata_t kgssapi_mod = {
|
||||
"kgssapi",
|
||||
|
@ -155,6 +155,8 @@ SUBDIR= ${_3dfx} \
|
||||
jme \
|
||||
joy \
|
||||
kbdmux \
|
||||
kgssapi \
|
||||
kgssapi_krb5 \
|
||||
khelp \
|
||||
krpc \
|
||||
ksyms \
|
||||
|
@ -8,7 +8,8 @@ SRCS= krb5_mech.c \
|
||||
kcrypto_des.c \
|
||||
kcrypto_des3.c \
|
||||
kcrypto_aes.c \
|
||||
kcrypto_arcfour.c
|
||||
kcrypto_arcfour.c \
|
||||
opt_inet6.h
|
||||
|
||||
SRCS+= kgss_if.h gssd.h
|
||||
MFILES= kgssapi/kgss_if.m
|
||||
|
@ -116,12 +116,6 @@ VNET_DEFINE(int, rttrash); /* routes not in table but not freed */
|
||||
static VNET_DEFINE(uma_zone_t, rtzone); /* Routing table UMA zone. */
|
||||
#define V_rtzone VNET(rtzone)
|
||||
|
||||
#if 0
|
||||
/* default fib for tunnels to use */
|
||||
u_int tunnel_fib = 0;
|
||||
SYSCTL_INT(_net, OID_AUTO, tunnelfib, CTLFLAG_RD, &tunnel_fib, 0, "");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* handler for net.my_fibnum
|
||||
*/
|
||||
@ -1189,6 +1183,7 @@ rtrequest1_fib(int req, struct rt_addrinfo *info, struct rtentry **ret_nrt,
|
||||
rt0 = NULL;
|
||||
/* XXX
|
||||
* "flow-table" only support IPv4 at the moment.
|
||||
* XXX-BZ as of r205066 it would support IPv6.
|
||||
*/
|
||||
#ifdef INET
|
||||
if (dst->sa_family == AF_INET) {
|
||||
|
@ -108,8 +108,6 @@ struct rt_metrics {
|
||||
#endif
|
||||
|
||||
extern u_int rt_numfibs; /* number fo usable routing tables */
|
||||
extern u_int tunnel_fib; /* tunnels use these */
|
||||
extern u_int fwd_fib; /* packets being forwarded use these routes */
|
||||
/*
|
||||
* XXX kernel function pointer `rt_output' is visible to applications.
|
||||
*/
|
||||
|
@ -217,6 +217,9 @@ static int ieee80211_addba_response(struct ieee80211_node *ni,
|
||||
int code, int baparamset, int batimeout);
|
||||
static void ieee80211_addba_stop(struct ieee80211_node *ni,
|
||||
struct ieee80211_tx_ampdu *tap);
|
||||
static void null_addba_response_timeout(struct ieee80211_node *ni,
|
||||
struct ieee80211_tx_ampdu *tap);
|
||||
|
||||
static void ieee80211_bar_response(struct ieee80211_node *ni,
|
||||
struct ieee80211_tx_ampdu *tap, int status);
|
||||
static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap);
|
||||
@ -234,6 +237,7 @@ ieee80211_ht_attach(struct ieee80211com *ic)
|
||||
ic->ic_ampdu_enable = ieee80211_ampdu_enable;
|
||||
ic->ic_addba_request = ieee80211_addba_request;
|
||||
ic->ic_addba_response = ieee80211_addba_response;
|
||||
ic->ic_addba_response_timeout = null_addba_response_timeout;
|
||||
ic->ic_addba_stop = ieee80211_addba_stop;
|
||||
ic->ic_bar_response = ieee80211_bar_response;
|
||||
ic->ic_ampdu_rx_start = ampdu_rx_start;
|
||||
@ -1691,14 +1695,23 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu *tap)
|
||||
tap->txa_flags &= ~(IEEE80211_AGGR_SETUP | IEEE80211_AGGR_NAK);
|
||||
}
|
||||
|
||||
/*
|
||||
* ADDBA response timeout.
|
||||
*
|
||||
* If software aggregation and per-TID queue management was done here,
|
||||
* that queue would be unpaused after the ADDBA timeout occurs.
|
||||
*/
|
||||
static void
|
||||
addba_timeout(void *arg)
|
||||
{
|
||||
struct ieee80211_tx_ampdu *tap = arg;
|
||||
struct ieee80211_node *ni = tap->txa_ni;
|
||||
struct ieee80211com *ic = ni->ni_ic;
|
||||
|
||||
/* XXX ? */
|
||||
tap->txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
|
||||
tap->txa_attempts++;
|
||||
ic->ic_addba_response_timeout(ni, tap);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1721,6 +1734,12 @@ addba_stop_timeout(struct ieee80211_tx_ampdu *tap)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
null_addba_response_timeout(struct ieee80211_node *ni,
|
||||
struct ieee80211_tx_ampdu *tap)
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Default method for requesting A-MPDU tx aggregation.
|
||||
* We setup the specified state block and start a timer
|
||||
|
@ -307,6 +307,8 @@ struct ieee80211com {
|
||||
int status, int baparamset, int batimeout);
|
||||
void (*ic_addba_stop)(struct ieee80211_node *,
|
||||
struct ieee80211_tx_ampdu *);
|
||||
void (*ic_addba_response_timeout)(struct ieee80211_node *,
|
||||
struct ieee80211_tx_ampdu *);
|
||||
/* BAR response received */
|
||||
void (*ic_bar_response)(struct ieee80211_node *,
|
||||
struct ieee80211_tx_ampdu *, int status);
|
||||
|
@ -668,7 +668,6 @@ dummynet_send(struct mbuf *m)
|
||||
break;
|
||||
|
||||
case DIR_OUT | PROTO_IPV6:
|
||||
SET_HOST_IPLEN(mtod(m, struct ip *));
|
||||
ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL);
|
||||
break;
|
||||
#endif
|
||||
|
@ -127,8 +127,9 @@ again:
|
||||
args.rule = *((struct ipfw_rule_ref *)(tag+1));
|
||||
m_tag_delete(*m0, tag);
|
||||
if (args.rule.info & IPFW_ONEPASS) {
|
||||
SET_HOST_IPLEN(mtod(*m0, struct ip *));
|
||||
return 0;
|
||||
if (mtod(*m0, struct ip *)->ip_v == 4)
|
||||
SET_HOST_IPLEN(mtod(*m0, struct ip *));
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1102,8 +1102,15 @@ send:
|
||||
m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen;
|
||||
}
|
||||
|
||||
#ifdef IPSEC
|
||||
KASSERT(len + hdrlen + ipoptlen - ipsec_optlen == m_length(m, NULL),
|
||||
("%s: mbuf chain shorter than expected: %ld + %u + %u - %u != %u",
|
||||
__func__, len, hdrlen, ipoptlen, ipsec_optlen, m_length(m, NULL)));
|
||||
#else
|
||||
KASSERT(len + hdrlen + ipoptlen == m_length(m, NULL),
|
||||
("%s: mbuf chain shorter than expected", __func__));
|
||||
("%s: mbuf chain shorter than expected: %ld + %u + %u != %u",
|
||||
__func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* In transmit state, time the transmission and arrange for
|
||||
|
@ -306,9 +306,7 @@ nfs_disconnect(struct nfsmount *nmp)
|
||||
client = nmp->nm_client;
|
||||
nmp->nm_client = NULL;
|
||||
mtx_unlock(&nmp->nm_mtx);
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_secpurge(client);
|
||||
#endif
|
||||
rpc_gss_secpurge_call(client);
|
||||
CLNT_CLOSE(client);
|
||||
CLNT_RELEASE(client);
|
||||
} else
|
||||
@ -325,18 +323,15 @@ nfs_safedisconnect(struct nfsmount *nmp)
|
||||
static AUTH *
|
||||
nfs_getauth(struct nfsmount *nmp, struct ucred *cred)
|
||||
{
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_service_t svc;
|
||||
AUTH *auth;
|
||||
#endif
|
||||
|
||||
switch (nmp->nm_secflavor) {
|
||||
#ifdef KGSSAPI
|
||||
case RPCSEC_GSS_KRB5:
|
||||
case RPCSEC_GSS_KRB5I:
|
||||
case RPCSEC_GSS_KRB5P:
|
||||
if (!nmp->nm_mech_oid)
|
||||
if (!rpc_gss_mech_to_oid("kerberosv5",
|
||||
if (!rpc_gss_mech_to_oid_call("kerberosv5",
|
||||
&nmp->nm_mech_oid))
|
||||
return (NULL);
|
||||
if (nmp->nm_secflavor == RPCSEC_GSS_KRB5)
|
||||
@ -345,12 +340,11 @@ nfs_getauth(struct nfsmount *nmp, struct ucred *cred)
|
||||
svc = rpc_gss_svc_integrity;
|
||||
else
|
||||
svc = rpc_gss_svc_privacy;
|
||||
auth = rpc_gss_secfind(nmp->nm_client, cred,
|
||||
auth = rpc_gss_secfind_call(nmp->nm_client, cred,
|
||||
nmp->nm_principal, nmp->nm_mech_oid, svc);
|
||||
if (auth)
|
||||
return (auth);
|
||||
/* fallthrough */
|
||||
#endif
|
||||
case AUTH_SYS:
|
||||
default:
|
||||
return (authunix_create(cred));
|
||||
|
@ -418,12 +418,9 @@ nfssvc_addsock(struct file *fp, struct thread *td)
|
||||
static int
|
||||
nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
|
||||
{
|
||||
#ifdef KGSSAPI
|
||||
char principal[128];
|
||||
int error;
|
||||
#endif
|
||||
|
||||
#ifdef KGSSAPI
|
||||
if (args) {
|
||||
error = copyinstr(args->principal, principal,
|
||||
sizeof(principal), NULL);
|
||||
@ -434,7 +431,6 @@ nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
|
||||
getcredhostname(td->td_ucred, principal + 4,
|
||||
sizeof(principal) - 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Only the first nfsd actually does any work. The RPC code
|
||||
@ -449,12 +445,10 @@ nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
|
||||
|
||||
NFSD_UNLOCK();
|
||||
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_set_svc_name(principal, "kerberosv5",
|
||||
rpc_gss_set_svc_name_call(principal, "kerberosv5",
|
||||
GSS_C_INDEFINITE, NFS_PROG, NFS_VER2);
|
||||
rpc_gss_set_svc_name(principal, "kerberosv5",
|
||||
rpc_gss_set_svc_name_call(principal, "kerberosv5",
|
||||
GSS_C_INDEFINITE, NFS_PROG, NFS_VER3);
|
||||
#endif
|
||||
|
||||
if (args) {
|
||||
nfsrv_pool->sp_minthreads = args->minthreads;
|
||||
@ -466,10 +460,8 @@ nfssvc_nfsd(struct thread *td, struct nfsd_nfsd_args *args)
|
||||
|
||||
svc_run(nfsrv_pool);
|
||||
|
||||
#ifdef KGSSAPI
|
||||
rpc_gss_clear_svc_name(NFS_PROG, NFS_VER2);
|
||||
rpc_gss_clear_svc_name(NFS_PROG, NFS_VER3);
|
||||
#endif
|
||||
rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER2);
|
||||
rpc_gss_clear_svc_name_call(NFS_PROG, NFS_VER3);
|
||||
|
||||
NFSD_LOCK();
|
||||
nfsrv_numnfsd--;
|
||||
|
@ -135,6 +135,7 @@ glc_attach(device_t dev)
|
||||
callout_init_mtx(&sc->sc_tick_ch, &sc->sc_mtx, 0);
|
||||
sc->next_txdma_slot = 0;
|
||||
sc->bsy_txdma_slots = 0;
|
||||
sc->sc_next_rxdma_slot = 0;
|
||||
sc->first_used_txdma_slot = -1;
|
||||
|
||||
/*
|
||||
@ -375,6 +376,14 @@ glc_tick(void *xsc)
|
||||
|
||||
mtx_assert(&sc->sc_mtx, MA_OWNED);
|
||||
|
||||
/*
|
||||
* XXX: Sometimes the RX queue gets stuck. Poke it periodically until
|
||||
* we figure out why. This will fail harmlessly if the RX queue is
|
||||
* already running.
|
||||
*/
|
||||
lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev,
|
||||
sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0);
|
||||
|
||||
if (sc->sc_wdog_timer == 0 || --sc->sc_wdog_timer != 0) {
|
||||
callout_reset(&sc->sc_tick_ch, hz, glc_tick, sc);
|
||||
return;
|
||||
@ -707,12 +716,19 @@ glc_rxintr(struct glc_softc *sc)
|
||||
struct ifnet *ifp = sc->sc_ifp;
|
||||
|
||||
bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map,
|
||||
BUS_DMASYNC_PREWRITE);
|
||||
BUS_DMASYNC_POSTREAD);
|
||||
|
||||
restart_rxdma = 0;
|
||||
while ((sc->sc_rxdmadesc[sc->sc_next_rxdma_slot].cmd_stat &
|
||||
GELIC_DESCR_OWNED) == 0) {
|
||||
i = sc->sc_next_rxdma_slot;
|
||||
sc->sc_next_rxdma_slot++;
|
||||
if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS)
|
||||
sc->sc_next_rxdma_slot = 0;
|
||||
|
||||
if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END)
|
||||
restart_rxdma = 1;
|
||||
|
||||
if (sc->sc_rxdmadesc[i].rxerror & GELIC_RXERRORS) {
|
||||
ifp->if_ierrors++;
|
||||
goto requeue;
|
||||
@ -738,9 +754,6 @@ glc_rxintr(struct glc_softc *sc)
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_len = sc->sc_rxdmadesc[i].valid_size;
|
||||
m->m_pkthdr.len = m->m_len;
|
||||
sc->sc_next_rxdma_slot++;
|
||||
if (sc->sc_next_rxdma_slot >= GLC_MAX_RX_PACKETS)
|
||||
sc->sc_next_rxdma_slot = 0;
|
||||
|
||||
if (sc->sc_rx_vlan >= 0)
|
||||
m_adj(m, 2);
|
||||
@ -750,16 +763,18 @@ glc_rxintr(struct glc_softc *sc)
|
||||
mtx_lock(&sc->sc_mtx);
|
||||
|
||||
requeue:
|
||||
if (sc->sc_rxdmadesc[i].cmd_stat & GELIC_CMDSTAT_CHAIN_END)
|
||||
restart_rxdma = 1;
|
||||
glc_add_rxbuf_dma(sc, i);
|
||||
if (restart_rxdma) {
|
||||
error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev,
|
||||
sc->sc_rxsoft[i].rxs_desc, 0);
|
||||
if (error != 0)
|
||||
device_printf(sc->sc_self,
|
||||
"lv1_net_start_rx_dma error: %d\n", error);
|
||||
}
|
||||
}
|
||||
|
||||
bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_rxdmadesc_map,
|
||||
BUS_DMASYNC_PREWRITE);
|
||||
|
||||
if (restart_rxdma) {
|
||||
error = lv1_net_start_rx_dma(sc->sc_bus, sc->sc_dev,
|
||||
sc->sc_rxsoft[sc->sc_next_rxdma_slot].rxs_desc, 0);
|
||||
if (error != 0)
|
||||
device_printf(sc->sc_self,
|
||||
"lv1_net_start_rx_dma error: %d\n", error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -770,6 +785,9 @@ glc_txintr(struct glc_softc *sc)
|
||||
struct glc_txsoft *txs;
|
||||
int progress = 0, kickstart = 0, error;
|
||||
|
||||
bus_dmamap_sync(sc->sc_dmadesc_tag, sc->sc_txdmadesc_map,
|
||||
BUS_DMASYNC_POSTREAD);
|
||||
|
||||
while ((txs = STAILQ_FIRST(&sc->sc_txdirtyq)) != NULL) {
|
||||
if (sc->sc_txdmadesc[txs->txs_lastdesc].cmd_stat
|
||||
& GELIC_DESCR_OWNED)
|
||||
@ -805,7 +823,8 @@ glc_txintr(struct glc_softc *sc)
|
||||
else
|
||||
sc->first_used_txdma_slot = -1;
|
||||
|
||||
if (kickstart && txs != NULL) {
|
||||
if (kickstart || txs != NULL) {
|
||||
/* Speculatively (or necessarily) start the TX queue again */
|
||||
error = lv1_net_start_tx_dma(sc->sc_bus, sc->sc_dev,
|
||||
sc->sc_txdmadesc_phys +
|
||||
txs->txs_firstdesc*sizeof(struct glc_dmadesc), 0);
|
||||
|
170
sys/powerpc/ps3/ohci_ps3.c
Normal file
170
sys/powerpc/ps3/ohci_ps3.c
Normal file
@ -0,0 +1,170 @@
|
||||
/*-
|
||||
* Copyright (C) 2010 Nathan Whitehorn
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 TOOLS GMBH 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.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/stdint.h>
|
||||
#include <sys/stddef.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/linker_set.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/condvar.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/sx.h>
|
||||
#include <sys/unistd.h>
|
||||
#include <sys/callout.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/priv.h>
|
||||
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <dev/usb/usb.h>
|
||||
#include <dev/usb/usbdi.h>
|
||||
|
||||
#include <dev/usb/usb_core.h>
|
||||
#include <dev/usb/usb_busdma.h>
|
||||
#include <dev/usb/usb_process.h>
|
||||
#include <dev/usb/usb_util.h>
|
||||
|
||||
#include <dev/usb/usb_controller.h>
|
||||
#include <dev/usb/usb_bus.h>
|
||||
#include <dev/usb/controller/ohci.h>
|
||||
#include <dev/usb/controller/ohcireg.h>
|
||||
|
||||
#include "ps3bus.h"
|
||||
|
||||
static int
|
||||
ohci_ps3_probe(device_t dev)
|
||||
{
|
||||
if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_SYSBUS ||
|
||||
ps3bus_get_devtype(dev) != PS3_DEVTYPE_USB)
|
||||
return (ENXIO);
|
||||
|
||||
device_set_desc(dev, "Playstation 3 USB 2.0 controller");
|
||||
return (BUS_PROBE_SPECIFIC);
|
||||
}
|
||||
|
||||
static int
|
||||
ohci_ps3_attach(device_t dev)
|
||||
{
|
||||
ohci_softc_t *sc = device_get_softc(dev);
|
||||
int rid, err;
|
||||
|
||||
sc->sc_bus.parent = dev;
|
||||
sc->sc_bus.devices = sc->sc_devices;
|
||||
sc->sc_bus.devices_max = OHCI_MAX_DEVICES;
|
||||
|
||||
if (usb_bus_mem_alloc_all(&sc->sc_bus,
|
||||
USB_GET_DMA_TAG(dev), &ohci_iterate_hw_softc))
|
||||
return (ENOMEM);
|
||||
|
||||
rid = 0;
|
||||
sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
|
||||
&rid, RF_ACTIVE);
|
||||
|
||||
if (!sc->sc_io_res) {
|
||||
device_printf(dev, "Could not map memory\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
sc->sc_io_tag = rman_get_bustag(sc->sc_io_res);
|
||||
sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res);
|
||||
sc->sc_io_size = rman_get_size(sc->sc_io_res);
|
||||
|
||||
rid = 0;
|
||||
sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
||||
RF_SHAREABLE | RF_ACTIVE);
|
||||
|
||||
if (sc->sc_irq_res == NULL) {
|
||||
device_printf(dev, "Could not allocate irq\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
sc->sc_bus.bdev = device_add_child(dev, "usbus", -1);
|
||||
if (!sc->sc_bus.bdev) {
|
||||
device_printf(dev, "Could not add USB device\n");
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus);
|
||||
|
||||
sprintf(sc->sc_vendor, "Sony");
|
||||
|
||||
err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE,
|
||||
NULL, (driver_intr_t *)ohci_interrupt, sc, &sc->sc_intr_hdl);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not setup error irq, %d\n", err);
|
||||
goto error;
|
||||
}
|
||||
|
||||
//sc->sc_flags |= EHCI_SCFLG_BIGEMMIO;
|
||||
bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl,
|
||||
OHCI_CONTROL, 0);
|
||||
err = ohci_init(sc);
|
||||
if (err) {
|
||||
device_printf(dev, "USB init failed err=%d\n", err);
|
||||
goto error;
|
||||
}
|
||||
|
||||
err = device_probe_and_attach(sc->sc_bus.bdev);
|
||||
if (err == 0)
|
||||
return (0);
|
||||
|
||||
error:
|
||||
return (ENXIO);
|
||||
}
|
||||
|
||||
static device_method_t ohci_ps3_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_probe, ohci_ps3_probe),
|
||||
DEVMETHOD(device_attach, ohci_ps3_attach),
|
||||
|
||||
/* Bus interface */
|
||||
DEVMETHOD(bus_print_child, bus_generic_print_child),
|
||||
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
static driver_t ohci_ps3_driver = {
|
||||
"ohci",
|
||||
ohci_ps3_methods,
|
||||
sizeof(ohci_softc_t),
|
||||
};
|
||||
|
||||
static devclass_t ohci_ps3_devclass;
|
||||
|
||||
DRIVER_MODULE(ohci_ps3, ps3bus, ohci_ps3_driver, ohci_ps3_devclass, 0, 0);
|
||||
MODULE_DEPEND(ohci_ps3, usb, 1, 1, 1);
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*-
|
||||
* Copyright (C) 2010 Nathan Whitehorn
|
||||
* Copyright (C) 2011 glevand (geoffrey.levand@mail.ru)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -73,6 +74,8 @@ struct ps3bus_devinfo {
|
||||
int dev;
|
||||
uint64_t bustype;
|
||||
uint64_t devtype;
|
||||
int busidx;
|
||||
int devidx;
|
||||
|
||||
struct resource_list resources;
|
||||
bus_dma_tag_t dma_tag;
|
||||
@ -89,6 +92,11 @@ enum ps3bus_irq_type {
|
||||
EHCI_IRQ = 4,
|
||||
};
|
||||
|
||||
enum ps3bus_reg_type {
|
||||
OHCI_REG = 3,
|
||||
EHCI_REG = 4,
|
||||
};
|
||||
|
||||
static device_method_t ps3bus_methods[] = {
|
||||
/* Device interface */
|
||||
DEVMETHOD(device_identify, ps3bus_identify),
|
||||
@ -235,6 +243,77 @@ ps3bus_resources_init(struct rman *rm, int bus_index, int dev_index,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ps3bus_resources_init_by_type(struct rman *rm, int bus_index, int dev_index,
|
||||
uint64_t irq_type, uint64_t reg_type, struct ps3bus_devinfo *dinfo)
|
||||
{
|
||||
uint64_t _irq_type, irq, outlet;
|
||||
uint64_t _reg_type, paddr, len;
|
||||
uint64_t ppe, junk;
|
||||
int i, result;
|
||||
int thread;
|
||||
|
||||
resource_list_init(&dinfo->resources);
|
||||
|
||||
lv1_get_logical_ppe_id(&ppe);
|
||||
thread = 32 - fls(mfctrl());
|
||||
|
||||
/* Scan for interrupts */
|
||||
for (i = 0; i < 10; i++) {
|
||||
result = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("intr") | i, 0, &_irq_type, &irq);
|
||||
|
||||
if (result != 0)
|
||||
break;
|
||||
|
||||
if (_irq_type != irq_type)
|
||||
continue;
|
||||
|
||||
lv1_construct_io_irq_outlet(irq, &outlet);
|
||||
lv1_connect_irq_plug_ext(ppe, thread, outlet, outlet,
|
||||
0);
|
||||
resource_list_add(&dinfo->resources, SYS_RES_IRQ, i,
|
||||
outlet, outlet, 1);
|
||||
}
|
||||
|
||||
/* Scan for registers */
|
||||
for (i = 0; i < 10; i++) {
|
||||
result = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("reg") | i,
|
||||
lv1_repository_string("type"), &_reg_type, &junk);
|
||||
|
||||
if (result != 0)
|
||||
break;
|
||||
|
||||
if (_reg_type != reg_type)
|
||||
continue;
|
||||
|
||||
result = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("reg") | i,
|
||||
lv1_repository_string("data"), &paddr, &len);
|
||||
|
||||
result = lv1_map_device_mmio_region(dinfo->bus, dinfo->dev,
|
||||
paddr, len, 12 /* log_2(4 KB) */, &paddr);
|
||||
|
||||
if (result != 0) {
|
||||
printf("Mapping registers failed for device "
|
||||
"%d.%d (%ld.%ld): %d\n", dinfo->bus, dinfo->dev,
|
||||
dinfo->bustype, dinfo->devtype, result);
|
||||
break;
|
||||
}
|
||||
|
||||
rman_manage_region(rm, paddr, paddr + len - 1);
|
||||
resource_list_add(&dinfo->resources, SYS_RES_MEMORY, i,
|
||||
paddr, paddr + len, len);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
ps3bus_attach(device_t self)
|
||||
{
|
||||
@ -294,30 +373,93 @@ ps3bus_attach(device_t self)
|
||||
if (result != 0)
|
||||
continue;
|
||||
|
||||
dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
|
||||
M_WAITOK | M_ZERO);
|
||||
switch (devtype) {
|
||||
case PS3_DEVTYPE_USB:
|
||||
/* USB device has OHCI and EHCI USB host controllers */
|
||||
|
||||
dinfo->bus = bus;
|
||||
dinfo->dev = dev;
|
||||
dinfo->bustype = bustype;
|
||||
dinfo->devtype = devtype;
|
||||
|
||||
if (dinfo->bustype == PS3_BUSTYPE_SYSBUS)
|
||||
lv1_open_device(bus, dev, 0);
|
||||
|
||||
ps3bus_resources_init(&sc->sc_mem_rman, bus_index,
|
||||
dev_index, dinfo);
|
||||
/* OHCI host controller */
|
||||
|
||||
cdev = device_add_child(self, NULL, -1);
|
||||
if (cdev == NULL) {
|
||||
device_printf(self,
|
||||
"device_add_child failed\n");
|
||||
free(dinfo, M_PS3BUS);
|
||||
continue;
|
||||
dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
dinfo->bus = bus;
|
||||
dinfo->dev = dev;
|
||||
dinfo->bustype = bustype;
|
||||
dinfo->devtype = devtype;
|
||||
dinfo->busidx = bus_index;
|
||||
dinfo->devidx = dev_index;
|
||||
|
||||
ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index,
|
||||
dev_index, OHCI_IRQ, OHCI_REG, dinfo);
|
||||
|
||||
cdev = device_add_child(self, "ohci", -1);
|
||||
if (cdev == NULL) {
|
||||
device_printf(self,
|
||||
"device_add_child failed\n");
|
||||
free(dinfo, M_PS3BUS);
|
||||
continue;
|
||||
}
|
||||
|
||||
mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
|
||||
device_set_ivars(cdev, dinfo);
|
||||
|
||||
/* EHCI host controller */
|
||||
|
||||
dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
dinfo->bus = bus;
|
||||
dinfo->dev = dev;
|
||||
dinfo->bustype = bustype;
|
||||
dinfo->devtype = devtype;
|
||||
dinfo->busidx = bus_index;
|
||||
dinfo->devidx = dev_index;
|
||||
|
||||
ps3bus_resources_init_by_type(&sc->sc_mem_rman, bus_index,
|
||||
dev_index, EHCI_IRQ, EHCI_REG, dinfo);
|
||||
|
||||
cdev = device_add_child(self, "ehci", -1);
|
||||
if (cdev == NULL) {
|
||||
device_printf(self,
|
||||
"device_add_child failed\n");
|
||||
free(dinfo, M_PS3BUS);
|
||||
continue;
|
||||
}
|
||||
|
||||
mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
|
||||
device_set_ivars(cdev, dinfo);
|
||||
break;
|
||||
default:
|
||||
dinfo = malloc(sizeof(*dinfo), M_PS3BUS,
|
||||
M_WAITOK | M_ZERO);
|
||||
|
||||
dinfo->bus = bus;
|
||||
dinfo->dev = dev;
|
||||
dinfo->bustype = bustype;
|
||||
dinfo->devtype = devtype;
|
||||
dinfo->busidx = bus_index;
|
||||
dinfo->devidx = dev_index;
|
||||
|
||||
if (dinfo->bustype == PS3_BUSTYPE_SYSBUS ||
|
||||
dinfo->bustype == PS3_BUSTYPE_STORAGE)
|
||||
lv1_open_device(bus, dev, 0);
|
||||
|
||||
ps3bus_resources_init(&sc->sc_mem_rman, bus_index,
|
||||
dev_index, dinfo);
|
||||
|
||||
cdev = device_add_child(self, NULL, -1);
|
||||
if (cdev == NULL) {
|
||||
device_printf(self,
|
||||
"device_add_child failed\n");
|
||||
free(dinfo, M_PS3BUS);
|
||||
continue;
|
||||
}
|
||||
|
||||
mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
|
||||
device_set_ivars(cdev, dinfo);
|
||||
}
|
||||
|
||||
mtx_init(&dinfo->iommu_mtx, "iommu", NULL, MTX_DEF);
|
||||
device_set_ivars(cdev, dinfo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -361,6 +503,12 @@ ps3bus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
|
||||
case PS3BUS_IVAR_DEVTYPE:
|
||||
*result = dinfo->devtype;
|
||||
break;
|
||||
case PS3BUS_IVAR_BUSIDX:
|
||||
*result = dinfo->busidx;
|
||||
break;
|
||||
case PS3BUS_IVAR_DEVIDX:
|
||||
*result = dinfo->devidx;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
@ -483,7 +631,8 @@ ps3bus_get_dma_tag(device_t dev, device_t child)
|
||||
struct ps3bus_softc *sc = device_get_softc(dev);
|
||||
int i, err, flags;
|
||||
|
||||
if (dinfo->bustype != PS3_BUSTYPE_SYSBUS)
|
||||
if (dinfo->bustype != PS3_BUSTYPE_SYSBUS &&
|
||||
dinfo->bustype != PS3_BUSTYPE_STORAGE)
|
||||
return (bus_get_dma_tag(dev));
|
||||
|
||||
mtx_lock(&dinfo->iommu_mtx);
|
||||
|
@ -32,7 +32,9 @@ enum {
|
||||
PS3BUS_IVAR_BUS,
|
||||
PS3BUS_IVAR_DEVICE,
|
||||
PS3BUS_IVAR_BUSTYPE,
|
||||
PS3BUS_IVAR_DEVTYPE
|
||||
PS3BUS_IVAR_DEVTYPE,
|
||||
PS3BUS_IVAR_BUSIDX,
|
||||
PS3BUS_IVAR_DEVIDX,
|
||||
};
|
||||
|
||||
#define PS3BUS_ACCESSOR(A, B, T) \
|
||||
@ -42,6 +44,8 @@ PS3BUS_ACCESSOR(bus, BUS, int)
|
||||
PS3BUS_ACCESSOR(device, DEVICE, int)
|
||||
PS3BUS_ACCESSOR(bustype, BUSTYPE, uint64_t)
|
||||
PS3BUS_ACCESSOR(devtype, DEVTYPE, uint64_t)
|
||||
PS3BUS_ACCESSOR(busidx, BUSIDX, int)
|
||||
PS3BUS_ACCESSOR(devidx, DEVIDX, int)
|
||||
|
||||
/* Bus types */
|
||||
enum {
|
||||
|
901
sys/powerpc/ps3/ps3disk.c
Normal file
901
sys/powerpc/ps3/ps3disk.c
Normal file
@ -0,0 +1,901 @@
|
||||
/*-
|
||||
* Copyright (C) 2011 glevand (geoffrey.levand@mail.ru)
|
||||
* 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.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/bio.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/kthread.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#include <vm/vm.h>
|
||||
#include <vm/pmap.h>
|
||||
|
||||
#include <machine/pio.h>
|
||||
#include <machine/bus.h>
|
||||
#include <machine/platform.h>
|
||||
#include <machine/pmap.h>
|
||||
#include <machine/resource.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <geom/geom_disk.h>
|
||||
|
||||
#include "ps3bus.h"
|
||||
#include "ps3-hvcall.h"
|
||||
|
||||
#define PS3DISK_LOCK_INIT(_sc) \
|
||||
mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), "ps3disk", MTX_DEF)
|
||||
#define PS3DISK_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx);
|
||||
#define PS3DISK_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx)
|
||||
#define PS3DISK_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)
|
||||
#define PS3DISK_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED);
|
||||
#define PS3DISK_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED);
|
||||
|
||||
#define LV1_STORAGE_ATA_HDDOUT 0x23
|
||||
|
||||
SYSCTL_NODE(_hw, OID_AUTO, ps3disk, CTLFLAG_RD, 0, "PS3 Disk driver parameters");
|
||||
|
||||
#ifdef PS3DISK_DEBUG
|
||||
static int ps3disk_debug = 0;
|
||||
SYSCTL_INT(_hw_ps3disk, OID_AUTO, debug, CTLFLAG_RW, &ps3disk_debug,
|
||||
0, "control debugging printfs");
|
||||
TUNABLE_INT("hw.ps3disk.debug", &ps3disk_debug);
|
||||
enum {
|
||||
PS3DISK_DEBUG_INTR = 0x00000001,
|
||||
PS3DISK_DEBUG_TASK = 0x00000002,
|
||||
PS3DISK_DEBUG_READ = 0x00000004,
|
||||
PS3DISK_DEBUG_WRITE = 0x00000008,
|
||||
PS3DISK_DEBUG_FLUSH = 0x00000010,
|
||||
PS3DISK_DEBUG_ANY = 0xffffffff
|
||||
};
|
||||
#define DPRINTF(sc, m, fmt, ...) \
|
||||
do { \
|
||||
if (sc->sc_debug & (m)) \
|
||||
printf(fmt, __VA_ARGS__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define DPRINTF(sc, m, fmt, ...)
|
||||
#endif
|
||||
|
||||
struct ps3disk_region {
|
||||
uint64_t r_id;
|
||||
uint64_t r_start;
|
||||
uint64_t r_size;
|
||||
uint64_t r_flags;
|
||||
};
|
||||
|
||||
struct ps3disk_softc {
|
||||
device_t sc_dev;
|
||||
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint64_t sc_blksize;
|
||||
uint64_t sc_nblocks;
|
||||
|
||||
uint64_t sc_nregs;
|
||||
struct ps3disk_region *sc_reg;
|
||||
|
||||
int sc_irqid;
|
||||
struct resource *sc_irq;
|
||||
void *sc_irqctx;
|
||||
|
||||
struct disk **sc_disk;
|
||||
|
||||
struct bio_queue_head sc_bioq;
|
||||
|
||||
struct proc *sc_task;
|
||||
|
||||
int sc_bounce_maxblocks;
|
||||
bus_dma_tag_t sc_bounce_dmatag;
|
||||
bus_dmamap_t sc_bounce_dmamap;
|
||||
bus_addr_t sc_bounce_dmaphys;
|
||||
char *sc_bounce;
|
||||
uint64_t sc_bounce_lpar;
|
||||
int sc_bounce_busy;
|
||||
uint64_t sc_bounce_tag;
|
||||
uint64_t sc_bounce_status;
|
||||
|
||||
int sc_running;
|
||||
|
||||
int sc_debug;
|
||||
};
|
||||
|
||||
static int ps3disk_open(struct disk *dp);
|
||||
static int ps3disk_close(struct disk *dp);
|
||||
static void ps3disk_strategy(struct bio *bp);
|
||||
static void ps3disk_task(void *arg);
|
||||
|
||||
static int ps3disk_intr_filter(void *arg);
|
||||
static void ps3disk_intr(void *arg);
|
||||
static void ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error);
|
||||
static int ps3disk_get_disk_geometry(struct ps3disk_softc *sc);
|
||||
static int ps3disk_enum_regions(struct ps3disk_softc *sc);
|
||||
static int ps3disk_read(struct ps3disk_softc *sc, int regidx,
|
||||
uint64_t start_sector, uint64_t sector_count, char *data);
|
||||
static int ps3disk_write(struct ps3disk_softc *sc, int regidx,
|
||||
uint64_t start_sector, uint64_t sector_count, char *data);
|
||||
static int ps3disk_flush(struct ps3disk_softc *sc);
|
||||
|
||||
static void ps3disk_sysctlattach(struct ps3disk_softc *sc);
|
||||
|
||||
static MALLOC_DEFINE(M_PS3DISK, "ps3disk", "PS3 Disk");
|
||||
|
||||
static int
|
||||
ps3disk_probe(device_t dev)
|
||||
{
|
||||
if (ps3bus_get_bustype(dev) != PS3_BUSTYPE_STORAGE ||
|
||||
ps3bus_get_devtype(dev) != PS3_DEVTYPE_DISK)
|
||||
return (ENXIO);
|
||||
|
||||
device_set_desc(dev, "Playstation 3 Disk");
|
||||
|
||||
return (BUS_PROBE_SPECIFIC);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_attach(device_t dev)
|
||||
{
|
||||
struct ps3disk_softc *sc;
|
||||
struct disk *d;
|
||||
intmax_t mb;
|
||||
char unit;
|
||||
int i, err;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
sc->sc_dev = dev;
|
||||
|
||||
PS3DISK_LOCK_INIT(sc);
|
||||
|
||||
err = ps3disk_get_disk_geometry(sc);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get disk geometry\n");
|
||||
err = ENXIO;
|
||||
goto fail_destroy_lock;
|
||||
}
|
||||
|
||||
device_printf(dev, "block size %lu total blocks %lu\n",
|
||||
sc->sc_blksize, sc->sc_nblocks);
|
||||
|
||||
err = ps3disk_enum_regions(sc);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not enumerate disk regions\n");
|
||||
err = ENXIO;
|
||||
goto fail_destroy_lock;
|
||||
}
|
||||
|
||||
device_printf(dev, "Found %lu regions\n", sc->sc_nregs);
|
||||
|
||||
if (!sc->sc_nregs) {
|
||||
err = ENXIO;
|
||||
goto fail_destroy_lock;
|
||||
}
|
||||
|
||||
/* Setup interrupt handler */
|
||||
|
||||
sc->sc_irqid = 0;
|
||||
sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_irqid,
|
||||
RF_ACTIVE);
|
||||
if (!sc->sc_irq) {
|
||||
device_printf(dev, "Could not allocate IRQ\n");
|
||||
err = ENXIO;
|
||||
goto fail_free_regions;
|
||||
}
|
||||
|
||||
err = bus_setup_intr(dev, sc->sc_irq,
|
||||
INTR_TYPE_BIO | INTR_MPSAFE | INTR_ENTROPY,
|
||||
ps3disk_intr_filter, ps3disk_intr, sc, &sc->sc_irqctx);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not setup IRQ\n");
|
||||
err = ENXIO;
|
||||
goto fail_release_intr;
|
||||
}
|
||||
|
||||
/* Setup DMA bounce buffer */
|
||||
|
||||
sc->sc_bounce_maxblocks = DFLTPHYS / sc->sc_blksize;
|
||||
|
||||
err = bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0,
|
||||
BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL,
|
||||
sc->sc_bounce_maxblocks * sc->sc_blksize, 1,
|
||||
sc->sc_bounce_maxblocks * sc->sc_blksize,
|
||||
0, NULL, NULL, &sc->sc_bounce_dmatag);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not create DMA tag for bounce buffer\n");
|
||||
err = ENXIO;
|
||||
goto fail_teardown_intr;
|
||||
}
|
||||
|
||||
err = bus_dmamem_alloc(sc->sc_bounce_dmatag, (void **) &sc->sc_bounce,
|
||||
BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO,
|
||||
&sc->sc_bounce_dmamap);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not allocate DMA memory for bounce buffer\n");
|
||||
err = ENXIO;
|
||||
goto fail_destroy_dmatag;
|
||||
}
|
||||
|
||||
err = bus_dmamap_load(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap,
|
||||
sc->sc_bounce, sc->sc_bounce_maxblocks * sc->sc_blksize,
|
||||
ps3disk_getphys, &sc->sc_bounce_dmaphys, 0);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not load DMA map for bounce buffer\n");
|
||||
err = ENXIO;
|
||||
goto fail_free_dmamem;
|
||||
}
|
||||
|
||||
sc->sc_bounce_lpar = vtophys(sc->sc_bounce);
|
||||
|
||||
if (bootverbose)
|
||||
device_printf(dev, "bounce buffer lpar address 0x%016lx\n",
|
||||
sc->sc_bounce_lpar);
|
||||
|
||||
/* Setup disks */
|
||||
|
||||
sc->sc_disk = malloc(sc->sc_nregs * sizeof(struct disk *),
|
||||
M_PS3DISK, M_ZERO | M_WAITOK);
|
||||
if (!sc->sc_disk) {
|
||||
device_printf(dev, "Could not allocate disk(s)\n");
|
||||
err = ENOMEM;
|
||||
goto fail_unload_dmamem;
|
||||
}
|
||||
|
||||
for (i = 0; i < sc->sc_nregs; i++) {
|
||||
struct ps3disk_region *rp = &sc->sc_reg[i];
|
||||
|
||||
d = sc->sc_disk[i] = disk_alloc();
|
||||
d->d_open = ps3disk_open;
|
||||
d->d_close = ps3disk_close;
|
||||
d->d_strategy = ps3disk_strategy;
|
||||
d->d_name = "ps3disk";
|
||||
d->d_drv1 = sc;
|
||||
d->d_maxsize = DFLTPHYS;
|
||||
d->d_sectorsize = sc->sc_blksize;
|
||||
d->d_unit = i;
|
||||
d->d_mediasize = sc->sc_reg[i].r_size * sc->sc_blksize;
|
||||
d->d_flags |= DISKFLAG_CANFLUSHCACHE;
|
||||
|
||||
mb = d->d_mediasize >> 20;
|
||||
unit = 'M';
|
||||
if (mb >= 10240) {
|
||||
unit = 'G';
|
||||
mb /= 1024;
|
||||
}
|
||||
|
||||
/* Test to see if we can read this region */
|
||||
err = lv1_storage_read(ps3bus_get_device(dev), d->d_unit,
|
||||
0, 1, rp->r_flags, sc->sc_bounce_lpar, &sc->sc_bounce_tag);
|
||||
device_printf(dev, "region %d %ju%cB%s\n", i, mb, unit,
|
||||
(err == 0) ? "" : " (hypervisor protected)");
|
||||
|
||||
if (err == 0)
|
||||
disk_create(d, DISK_VERSION);
|
||||
}
|
||||
err = 0;
|
||||
|
||||
bioq_init(&sc->sc_bioq);
|
||||
|
||||
ps3disk_sysctlattach(sc);
|
||||
|
||||
sc->sc_running = 1;
|
||||
|
||||
kproc_create(&ps3disk_task, sc, &sc->sc_task, 0, 0, "task: ps3disk");
|
||||
|
||||
return (0);
|
||||
|
||||
fail_unload_dmamem:
|
||||
|
||||
bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap);
|
||||
|
||||
fail_free_dmamem:
|
||||
|
||||
bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap);
|
||||
|
||||
fail_destroy_dmatag:
|
||||
|
||||
bus_dma_tag_destroy(sc->sc_bounce_dmatag);
|
||||
|
||||
fail_teardown_intr:
|
||||
|
||||
bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx);
|
||||
|
||||
fail_release_intr:
|
||||
|
||||
bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq);
|
||||
|
||||
fail_free_regions:
|
||||
|
||||
free(sc->sc_reg, M_PS3DISK);
|
||||
|
||||
fail_destroy_lock:
|
||||
|
||||
PS3DISK_LOCK_DESTROY(sc);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_detach(device_t dev)
|
||||
{
|
||||
struct ps3disk_softc *sc = device_get_softc(dev);
|
||||
int i;
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
sc->sc_running = 0;
|
||||
wakeup(sc);
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
while (sc->sc_running != -1)
|
||||
msleep(sc, &sc->sc_mtx, PRIBIO, "detach", 0);
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
for (i = 0; i < sc->sc_nregs; i++)
|
||||
disk_destroy(sc->sc_disk[i]);
|
||||
|
||||
bus_dmamap_unload(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap);
|
||||
bus_dmamem_free(sc->sc_bounce_dmatag, sc->sc_bounce, sc->sc_bounce_dmamap);
|
||||
bus_dma_tag_destroy(sc->sc_bounce_dmatag);
|
||||
|
||||
bus_teardown_intr(dev, sc->sc_irq, sc->sc_irqctx);
|
||||
bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irqid, sc->sc_irq);
|
||||
|
||||
free(sc->sc_disk, M_PS3DISK);
|
||||
|
||||
free(sc->sc_reg, M_PS3DISK);
|
||||
|
||||
PS3DISK_LOCK_DESTROY(sc);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_open(struct disk *dp)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_close(struct disk *dp)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
ps3disk_strategy(struct bio *bp)
|
||||
{
|
||||
struct ps3disk_softc *sc = (struct ps3disk_softc *) bp->bio_disk->d_drv1;
|
||||
|
||||
if (!sc) {
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
bp->bio_error = EINVAL;
|
||||
biodone(bp);
|
||||
return;
|
||||
}
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
bioq_disksort(&sc->sc_bioq, bp);
|
||||
if (!sc->sc_bounce_busy)
|
||||
wakeup(sc);
|
||||
PS3DISK_UNLOCK(sc);
|
||||
}
|
||||
|
||||
static void
|
||||
ps3disk_task(void *arg)
|
||||
{
|
||||
struct ps3disk_softc *sc = (struct ps3disk_softc *) arg;
|
||||
struct bio *bp;
|
||||
daddr_t block, end;
|
||||
u_long nblocks;
|
||||
char *data;
|
||||
int err;
|
||||
|
||||
while (sc->sc_running) {
|
||||
PS3DISK_LOCK(sc);
|
||||
do {
|
||||
bp = bioq_first(&sc->sc_bioq);
|
||||
if (bp == NULL)
|
||||
msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0);
|
||||
} while (bp == NULL && sc->sc_running);
|
||||
if (bp)
|
||||
bioq_remove(&sc->sc_bioq, bp);
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
if (!sc->sc_running)
|
||||
break;
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_cmd 0x%02x\n",
|
||||
__func__, bp->bio_cmd);
|
||||
|
||||
if (bp->bio_cmd == BIO_FLUSH) {
|
||||
err = ps3disk_flush(sc);
|
||||
|
||||
if (err) {
|
||||
bp->bio_error = EIO;
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
} else {
|
||||
bp->bio_error = 0;
|
||||
bp->bio_flags |= BIO_DONE;
|
||||
}
|
||||
} else if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) {
|
||||
end = bp->bio_pblkno + (bp->bio_bcount / sc->sc_blksize);
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_pblkno %ld bio_bcount %ld\n",
|
||||
__func__, bp->bio_pblkno, bp->bio_bcount);
|
||||
|
||||
for (block = bp->bio_pblkno; block < end;) {
|
||||
data = bp->bio_data +
|
||||
(block - bp->bio_pblkno) * sc->sc_blksize;
|
||||
|
||||
nblocks = end - block;
|
||||
if (nblocks > sc->sc_bounce_maxblocks)
|
||||
nblocks = sc->sc_bounce_maxblocks;
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: nblocks %lu\n",
|
||||
__func__, nblocks);
|
||||
|
||||
if (bp->bio_cmd == BIO_READ) {
|
||||
err = ps3disk_read(sc, bp->bio_disk->d_unit,
|
||||
block, nblocks, data);
|
||||
} else {
|
||||
err = ps3disk_write(sc, bp->bio_disk->d_unit,
|
||||
block, nblocks, data);
|
||||
}
|
||||
|
||||
if (err)
|
||||
break;
|
||||
|
||||
block += nblocks;
|
||||
}
|
||||
|
||||
bp->bio_resid = (end - block) * sc->sc_blksize;
|
||||
if (bp->bio_resid) {
|
||||
bp->bio_error = EIO;
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
} else {
|
||||
bp->bio_error = 0;
|
||||
bp->bio_flags |= BIO_DONE;
|
||||
}
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_TASK, "%s: bio_resid %ld\n",
|
||||
__func__, bp->bio_resid);
|
||||
} else {
|
||||
bp->bio_error = EINVAL;
|
||||
bp->bio_flags |= BIO_ERROR;
|
||||
}
|
||||
|
||||
if (bp->bio_flags & BIO_ERROR)
|
||||
disk_err(bp, "hard error", -1, 1);
|
||||
|
||||
biodone(bp);
|
||||
}
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
sc->sc_running = -1;
|
||||
wakeup(sc);
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
kproc_exit(0);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_intr_filter(void *arg)
|
||||
{
|
||||
return (FILTER_SCHEDULE_THREAD);
|
||||
}
|
||||
|
||||
static void
|
||||
ps3disk_intr(void *arg)
|
||||
{
|
||||
struct ps3disk_softc *sc = (struct ps3disk_softc *) arg;
|
||||
device_t dev = sc->sc_dev;
|
||||
uint64_t devid = ps3bus_get_device(dev);
|
||||
uint64_t tag, status;
|
||||
int err;
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
|
||||
err = lv1_storage_get_async_status(devid, &tag, &status);
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_INTR, "%s: err %d tag 0x%016lx status 0x%016lx\n",
|
||||
__func__, err, tag, status);
|
||||
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
if (!sc->sc_bounce_busy) {
|
||||
device_printf(dev, "Got interrupt while no request pending\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (tag != sc->sc_bounce_tag)
|
||||
device_printf(dev, "Tag mismatch, got 0x%016lx expected 0x%016lx\n",
|
||||
tag, sc->sc_bounce_tag);
|
||||
|
||||
if (status)
|
||||
device_printf(dev, "Request completed with status 0x%016lx\n", status);
|
||||
|
||||
sc->sc_bounce_status = status;
|
||||
sc->sc_bounce_busy = 0;
|
||||
|
||||
wakeup(sc);
|
||||
|
||||
out:
|
||||
|
||||
PS3DISK_UNLOCK(sc);
|
||||
}
|
||||
|
||||
static void
|
||||
ps3disk_getphys(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
|
||||
{
|
||||
if (error != 0)
|
||||
return;
|
||||
|
||||
*(bus_addr_t *) arg = segs[0].ds_addr;
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_get_disk_geometry(struct ps3disk_softc *sc)
|
||||
{
|
||||
device_t dev = sc->sc_dev;
|
||||
uint64_t bus_index = ps3bus_get_busidx(dev);
|
||||
uint64_t dev_index = ps3bus_get_devidx(dev);
|
||||
uint64_t junk;
|
||||
int err;
|
||||
|
||||
err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("blk_size"), 0, &sc->sc_blksize, &junk);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get block size (0x%08x)\n", err);
|
||||
err = ENXIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("n_blocks"), 0, &sc->sc_nblocks, &junk);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get total number of blocks (0x%08x)\n",
|
||||
err);
|
||||
err = ENXIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = 0;
|
||||
|
||||
out:
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_enum_regions(struct ps3disk_softc *sc)
|
||||
{
|
||||
device_t dev = sc->sc_dev;
|
||||
uint64_t bus_index = ps3bus_get_busidx(dev);
|
||||
uint64_t dev_index = ps3bus_get_devidx(dev);
|
||||
uint64_t junk;
|
||||
int i, err;
|
||||
|
||||
/* Read number of regions */
|
||||
|
||||
err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("n_regs"), 0, &sc->sc_nregs, &junk);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get number of regions (0x%08x)\n",
|
||||
err);
|
||||
err = ENXIO;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!sc->sc_nregs)
|
||||
return 0;
|
||||
|
||||
sc->sc_reg = malloc(sc->sc_nregs * sizeof(struct ps3disk_region),
|
||||
M_PS3DISK, M_ZERO | M_WAITOK);
|
||||
if (!sc->sc_reg) {
|
||||
err = ENOMEM;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Setup regions */
|
||||
|
||||
for (i = 0; i < sc->sc_nregs; i++) {
|
||||
err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("region") | i,
|
||||
lv1_repository_string("id"), &sc->sc_reg[i].r_id, &junk);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get region id (0x%08x)\n",
|
||||
err);
|
||||
err = ENXIO;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("region") | i,
|
||||
lv1_repository_string("start"), &sc->sc_reg[i].r_start, &junk);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get region start (0x%08x)\n",
|
||||
err);
|
||||
err = ENXIO;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
err = lv1_get_repository_node_value(PS3_LPAR_ID_PME,
|
||||
(lv1_repository_string("bus") >> 32) | bus_index,
|
||||
lv1_repository_string("dev") | dev_index,
|
||||
lv1_repository_string("region") | i,
|
||||
lv1_repository_string("size"), &sc->sc_reg[i].r_size, &junk);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not get region size (0x%08x)\n",
|
||||
err);
|
||||
err = ENXIO;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
/* disables HV access control and grants access to whole disk */
|
||||
sc->sc_reg[i].r_flags = 0x2;
|
||||
else
|
||||
sc->sc_reg[i].r_flags = 0;
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
fail:
|
||||
|
||||
sc->sc_nregs = 0;
|
||||
if (sc->sc_reg)
|
||||
free(sc->sc_reg, M_PS3DISK);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_read(struct ps3disk_softc *sc, int regidx,
|
||||
uint64_t start_sector, uint64_t sector_count, char *data)
|
||||
{
|
||||
device_t dev = sc->sc_dev;
|
||||
struct ps3disk_region *rp = &sc->sc_reg[regidx];
|
||||
uint64_t devid = ps3bus_get_device(dev);
|
||||
int err;
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
|
||||
if (sc->sc_bounce_busy) {
|
||||
device_printf(dev, "busy\n");
|
||||
PS3DISK_UNLOCK(sc);
|
||||
return EIO;
|
||||
}
|
||||
|
||||
sc->sc_bounce_busy = 1;
|
||||
|
||||
err = lv1_storage_read(devid, rp->r_id,
|
||||
start_sector, sector_count, rp->r_flags,
|
||||
sc->sc_bounce_lpar, &sc->sc_bounce_tag);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not read sectors (0x%08x)\n", err);
|
||||
err = EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_READ, "%s: tag 0x%016lx\n",
|
||||
__func__, sc->sc_bounce_tag);
|
||||
|
||||
err = msleep(sc, &sc->sc_mtx, PRIBIO, "read", hz);
|
||||
if (err) {
|
||||
device_printf(dev, "Read request timed out\n");
|
||||
err = EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (sc->sc_bounce_busy || sc->sc_bounce_status) {
|
||||
err = EIO;
|
||||
} else {
|
||||
bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap,
|
||||
BUS_DMASYNC_POSTREAD);
|
||||
memcpy(data, sc->sc_bounce, sector_count * sc->sc_blksize);
|
||||
err = 0;
|
||||
}
|
||||
|
||||
out:
|
||||
|
||||
sc->sc_bounce_busy = 0;
|
||||
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_write(struct ps3disk_softc *sc, int regidx,
|
||||
uint64_t start_sector, uint64_t sector_count, char *data)
|
||||
{
|
||||
device_t dev = sc->sc_dev;
|
||||
struct ps3disk_region *rp = &sc->sc_reg[regidx];
|
||||
uint64_t devid = ps3bus_get_device(dev);
|
||||
int err;
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
|
||||
if (sc->sc_bounce_busy) {
|
||||
device_printf(dev, "busy\n");
|
||||
PS3DISK_UNLOCK(sc);
|
||||
return EIO;
|
||||
}
|
||||
|
||||
memcpy(sc->sc_bounce, data, sector_count * sc->sc_blksize);
|
||||
|
||||
bus_dmamap_sync(sc->sc_bounce_dmatag, sc->sc_bounce_dmamap,
|
||||
BUS_DMASYNC_PREWRITE);
|
||||
|
||||
sc->sc_bounce_busy = 1;
|
||||
|
||||
err = lv1_storage_write(devid, rp->r_id,
|
||||
start_sector, sector_count, rp->r_flags,
|
||||
sc->sc_bounce_lpar, &sc->sc_bounce_tag);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not write sectors (0x%08x)\n", err);
|
||||
err = EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_WRITE, "%s: tag 0x%016lx\n",
|
||||
__func__, sc->sc_bounce_tag);
|
||||
|
||||
err = msleep(sc, &sc->sc_mtx, PRIBIO, "write", hz);
|
||||
if (err) {
|
||||
device_printf(dev, "Write request timed out\n");
|
||||
err = EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0;
|
||||
|
||||
out:
|
||||
|
||||
sc->sc_bounce_busy = 0;
|
||||
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
ps3disk_flush(struct ps3disk_softc *sc)
|
||||
{
|
||||
device_t dev = sc->sc_dev;
|
||||
uint64_t devid = ps3bus_get_device(dev);
|
||||
int err;
|
||||
|
||||
PS3DISK_LOCK(sc);
|
||||
|
||||
if (sc->sc_bounce_busy) {
|
||||
device_printf(dev, "busy\n");
|
||||
PS3DISK_UNLOCK(sc);
|
||||
return EIO;
|
||||
}
|
||||
|
||||
sc->sc_bounce_busy = 1;
|
||||
|
||||
err = lv1_storage_send_device_command(devid, LV1_STORAGE_ATA_HDDOUT,
|
||||
0, 0, 0, 0, &sc->sc_bounce_tag);
|
||||
if (err) {
|
||||
device_printf(dev, "Could not flush (0x%08x)\n", err);
|
||||
err = EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
DPRINTF(sc, PS3DISK_DEBUG_FLUSH, "%s: tag 0x%016lx\n",
|
||||
__func__, sc->sc_bounce_tag);
|
||||
|
||||
err = msleep(sc, &sc->sc_mtx, PRIBIO, "flush", hz);
|
||||
if (err) {
|
||||
device_printf(dev, "Flush request timed out\n");
|
||||
err = EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
err = (sc->sc_bounce_busy || sc->sc_bounce_status) ? EIO : 0;
|
||||
|
||||
out:
|
||||
|
||||
sc->sc_bounce_busy = 0;
|
||||
|
||||
PS3DISK_UNLOCK(sc);
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
||||
#ifdef PS3DISK_DEBUG
|
||||
static int
|
||||
ps3disk_sysctl_debug(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct ps3disk_softc *sc = arg1;
|
||||
int debug, error;
|
||||
|
||||
debug = sc->sc_debug;
|
||||
|
||||
error = sysctl_handle_int(oidp, &debug, 0, req);
|
||||
if (error || !req->newptr)
|
||||
return error;
|
||||
|
||||
sc->sc_debug = debug;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
ps3disk_sysctlattach(struct ps3disk_softc *sc)
|
||||
{
|
||||
#ifdef PS3DISK_DEBUG
|
||||
struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->sc_dev);
|
||||
struct sysctl_oid *tree = device_get_sysctl_tree(sc->sc_dev);
|
||||
|
||||
sc->sc_debug = ps3disk_debug;
|
||||
|
||||
SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO,
|
||||
"debug", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
|
||||
ps3disk_sysctl_debug, "I", "control debugging printfs");
|
||||
#endif
|
||||
}
|
||||
|
||||
static device_method_t ps3disk_methods[] = {
|
||||
DEVMETHOD(device_probe, ps3disk_probe),
|
||||
DEVMETHOD(device_attach, ps3disk_attach),
|
||||
DEVMETHOD(device_detach, ps3disk_detach),
|
||||
{0, 0},
|
||||
};
|
||||
|
||||
static driver_t ps3disk_driver = {
|
||||
"ps3disk",
|
||||
ps3disk_methods,
|
||||
sizeof(struct ps3disk_softc),
|
||||
};
|
||||
|
||||
static devclass_t ps3disk_devclass;
|
||||
|
||||
DRIVER_MODULE(ps3disk, ps3bus, ps3disk_driver, ps3disk_devclass, 0, 0);
|
@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <rpc/rpc.h>
|
||||
#include <rpc/nettype.h>
|
||||
#include <rpc/rpcsec_gss.h>
|
||||
|
||||
#include <rpc/rpc_com.h>
|
||||
|
||||
@ -69,6 +70,9 @@ extern u_long sb_max_adj; /* not defined in socketvar.h */
|
||||
#define strrchr rindex
|
||||
#endif
|
||||
|
||||
/* Provide an entry point hook for the rpcsec_gss module. */
|
||||
struct rpc_gss_entries rpc_gss_entries;
|
||||
|
||||
struct handle {
|
||||
NCONF_HANDLE *nhandle;
|
||||
int nflag; /* Whether NETPATH or NETCONFIG */
|
||||
|
@ -141,6 +141,271 @@ typedef struct {
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef _KERNEL
|
||||
/*
|
||||
* Set up a structure of entry points for the kgssapi module and inline
|
||||
* functions named rpc_gss_XXX_call() to use them, so that the kgssapi
|
||||
* module doesn't need to be loaded for the NFS modules to work using
|
||||
* AUTH_SYS. The kgssapi modules will be loaded by the gssd(8) daemon
|
||||
* when it is started up and the entry points will then be filled in.
|
||||
*/
|
||||
typedef AUTH *rpc_gss_secfind_ftype(CLIENT *clnt, struct ucred *cred,
|
||||
const char *principal, gss_OID mech_oid,
|
||||
rpc_gss_service_t service);
|
||||
typedef void rpc_gss_secpurge_ftype(CLIENT *clnt);
|
||||
typedef AUTH *rpc_gss_seccreate_ftype(CLIENT *clnt, struct ucred *cred,
|
||||
const char *principal, const char *mechanism,
|
||||
rpc_gss_service_t service, const char *qop,
|
||||
rpc_gss_options_req_t *options_req,
|
||||
rpc_gss_options_ret_t *options_ret);
|
||||
typedef bool_t rpc_gss_set_defaults_ftype(AUTH *auth,
|
||||
rpc_gss_service_t service, const char *qop);
|
||||
typedef int rpc_gss_max_data_length_ftype(AUTH *handle,
|
||||
int max_tp_unit_len);
|
||||
typedef void rpc_gss_get_error_ftype(rpc_gss_error_t *error);
|
||||
typedef bool_t rpc_gss_mech_to_oid_ftype(const char *mech, gss_OID *oid_ret);
|
||||
typedef bool_t rpc_gss_oid_to_mech_ftype(gss_OID oid, const char **mech_ret);
|
||||
typedef bool_t rpc_gss_qop_to_num_ftype(const char *qop, const char *mech,
|
||||
u_int *num_ret);
|
||||
typedef const char **rpc_gss_get_mechanisms_ftype(void);
|
||||
typedef bool_t rpc_gss_get_versions_ftype(u_int *vers_hi, u_int *vers_lo);
|
||||
typedef bool_t rpc_gss_is_installed_ftype(const char *mech);
|
||||
typedef bool_t rpc_gss_set_svc_name_ftype(const char *principal,
|
||||
const char *mechanism, u_int req_time, u_int program,
|
||||
u_int version);
|
||||
typedef void rpc_gss_clear_svc_name_ftype(u_int program, u_int version);
|
||||
typedef bool_t rpc_gss_getcred_ftype(struct svc_req *req,
|
||||
rpc_gss_rawcred_t **rcred,
|
||||
rpc_gss_ucred_t **ucred, void **cookie);
|
||||
typedef bool_t rpc_gss_set_callback_ftype(rpc_gss_callback_t *cb);
|
||||
typedef void rpc_gss_clear_callback_ftype(rpc_gss_callback_t *cb);
|
||||
typedef bool_t rpc_gss_get_principal_name_ftype(rpc_gss_principal_t *principal,
|
||||
const char *mech, const char *name, const char *node,
|
||||
const char *domain);
|
||||
typedef int rpc_gss_svc_max_data_length_ftype(struct svc_req *req,
|
||||
int max_tp_unit_len);
|
||||
|
||||
struct rpc_gss_entries {
|
||||
rpc_gss_secfind_ftype *rpc_gss_secfind;
|
||||
rpc_gss_secpurge_ftype *rpc_gss_secpurge;
|
||||
rpc_gss_seccreate_ftype *rpc_gss_seccreate;
|
||||
rpc_gss_set_defaults_ftype *rpc_gss_set_defaults;
|
||||
rpc_gss_max_data_length_ftype *rpc_gss_max_data_length;
|
||||
rpc_gss_get_error_ftype *rpc_gss_get_error;
|
||||
rpc_gss_mech_to_oid_ftype *rpc_gss_mech_to_oid;
|
||||
rpc_gss_oid_to_mech_ftype *rpc_gss_oid_to_mech;
|
||||
rpc_gss_qop_to_num_ftype *rpc_gss_qop_to_num;
|
||||
rpc_gss_get_mechanisms_ftype *rpc_gss_get_mechanisms;
|
||||
rpc_gss_get_versions_ftype *rpc_gss_get_versions;
|
||||
rpc_gss_is_installed_ftype *rpc_gss_is_installed;
|
||||
rpc_gss_set_svc_name_ftype *rpc_gss_set_svc_name;
|
||||
rpc_gss_clear_svc_name_ftype *rpc_gss_clear_svc_name;
|
||||
rpc_gss_getcred_ftype *rpc_gss_getcred;
|
||||
rpc_gss_set_callback_ftype *rpc_gss_set_callback;
|
||||
rpc_gss_clear_callback_ftype *rpc_gss_clear_callback;
|
||||
rpc_gss_get_principal_name_ftype *rpc_gss_get_principal_name;
|
||||
rpc_gss_svc_max_data_length_ftype *rpc_gss_svc_max_data_length;
|
||||
};
|
||||
extern struct rpc_gss_entries rpc_gss_entries;
|
||||
|
||||
/* Functions to access the entry points. */
|
||||
static __inline AUTH *
|
||||
rpc_gss_secfind_call(CLIENT *clnt, struct ucred *cred, const char *principal,
|
||||
gss_OID mech_oid, rpc_gss_service_t service)
|
||||
{
|
||||
AUTH *ret = NULL;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_secfind != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_secfind)(clnt, cred, principal,
|
||||
mech_oid, service);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
rpc_gss_secpurge_call(CLIENT *clnt)
|
||||
{
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_secpurge != NULL)
|
||||
(*rpc_gss_entries.rpc_gss_secpurge)(clnt);
|
||||
}
|
||||
|
||||
static __inline AUTH *
|
||||
rpc_gss_seccreate_call(CLIENT *clnt, struct ucred *cred, const char *principal,
|
||||
const char *mechanism, rpc_gss_service_t service, const char *qop,
|
||||
rpc_gss_options_req_t *options_req, rpc_gss_options_ret_t *options_ret)
|
||||
{
|
||||
AUTH *ret = NULL;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_seccreate != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_seccreate)(clnt, cred,
|
||||
principal, mechanism, service, qop, options_req,
|
||||
options_ret);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_set_defaults_call(AUTH *auth, rpc_gss_service_t service,
|
||||
const char *qop)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_set_defaults != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_set_defaults)(auth, service,
|
||||
qop);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
rpc_gss_max_data_length_call(AUTH *handle, int max_tp_unit_len)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_max_data_length != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_max_data_length)(handle,
|
||||
max_tp_unit_len);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
rpc_gss_get_error_call(rpc_gss_error_t *error)
|
||||
{
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_get_error != NULL)
|
||||
(*rpc_gss_entries.rpc_gss_get_error)(error);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_mech_to_oid_call(const char *mech, gss_OID *oid_ret)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_mech_to_oid != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_mech_to_oid)(mech, oid_ret);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_oid_to_mech_call(gss_OID oid, const char **mech_ret)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_oid_to_mech != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_oid_to_mech)(oid, mech_ret);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_qop_to_num_call(const char *qop, const char *mech, u_int *num_ret)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_qop_to_num != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_qop_to_num)(qop, mech, num_ret);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline const char **
|
||||
rpc_gss_get_mechanisms_call(void)
|
||||
{
|
||||
const char **ret = NULL;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_get_mechanisms != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_get_mechanisms)();
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_get_versions_call(u_int *vers_hi, u_int *vers_lo)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_get_versions != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_get_versions)(vers_hi, vers_lo);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_is_installed_call(const char *mech)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_is_installed != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_is_installed)(mech);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_set_svc_name_call(const char *principal, const char *mechanism,
|
||||
u_int req_time, u_int program, u_int version)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_set_svc_name != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_set_svc_name)(principal,
|
||||
mechanism, req_time, program, version);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
rpc_gss_clear_svc_name_call(u_int program, u_int version)
|
||||
{
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_clear_svc_name != NULL)
|
||||
(*rpc_gss_entries.rpc_gss_clear_svc_name)(program, version);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_getcred_call(struct svc_req *req, rpc_gss_rawcred_t **rcred,
|
||||
rpc_gss_ucred_t **ucred, void **cookie)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_getcred != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_getcred)(req, rcred, ucred,
|
||||
cookie);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_set_callback_call(rpc_gss_callback_t *cb)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_set_callback != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_set_callback)(cb);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline void
|
||||
rpc_gss_clear_callback_call(rpc_gss_callback_t *cb)
|
||||
{
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_clear_callback != NULL)
|
||||
(*rpc_gss_entries.rpc_gss_clear_callback)(cb);
|
||||
}
|
||||
|
||||
static __inline bool_t
|
||||
rpc_gss_get_principal_name_call(rpc_gss_principal_t *principal,
|
||||
const char *mech, const char *name, const char *node, const char *domain)
|
||||
{
|
||||
bool_t ret = 1;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_get_principal_name != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_get_principal_name)(principal,
|
||||
mech, name, node, domain);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static __inline int
|
||||
rpc_gss_svc_max_data_length_call(struct svc_req *req, int max_tp_unit_len)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
if (rpc_gss_entries.rpc_gss_svc_max_data_length != NULL)
|
||||
ret = (*rpc_gss_entries.rpc_gss_svc_max_data_length)(req,
|
||||
max_tp_unit_len);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
AUTH *rpc_gss_secfind(CLIENT *clnt, struct ucred *cred,
|
||||
const char *principal, gss_OID mech_oid, rpc_gss_service_t service);
|
||||
void rpc_gss_secpurge(CLIENT *clnt);
|
||||
|
@ -140,8 +140,6 @@ static cpu_ipi_single_t spitfire_ipi_single;
|
||||
SYSINIT(cpu_mp_unleash, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL);
|
||||
|
||||
CTASSERT(MAXCPU <= IDR_CHEETAH_MAX_BN_PAIRS);
|
||||
CTASSERT(MAXCPU <= sizeof(u_int) * NBBY);
|
||||
CTASSERT(MAXCPU <= sizeof(int) * NBBY);
|
||||
|
||||
void
|
||||
mp_init(u_int cpu_impl)
|
||||
|
@ -2217,11 +2217,10 @@ pmap_activate(struct thread *td)
|
||||
struct pmap *pm;
|
||||
int context;
|
||||
|
||||
critical_enter();
|
||||
vm = td->td_proc->p_vmspace;
|
||||
pm = vmspace_pmap(vm);
|
||||
|
||||
mtx_lock_spin(&sched_lock);
|
||||
|
||||
context = PCPU_GET(tlb_ctx);
|
||||
if (context == PCPU_GET(tlb_ctx_max)) {
|
||||
tlb_flush_user();
|
||||
@ -2229,17 +2228,18 @@ pmap_activate(struct thread *td)
|
||||
}
|
||||
PCPU_SET(tlb_ctx, context + 1);
|
||||
|
||||
mtx_lock_spin(&sched_lock);
|
||||
pm->pm_context[curcpu] = context;
|
||||
CPU_SET(PCPU_GET(cpuid), &pm->pm_active);
|
||||
PCPU_SET(pmap, pm);
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
|
||||
stxa(AA_DMMU_TSB, ASI_DMMU, pm->pm_tsb);
|
||||
stxa(AA_IMMU_TSB, ASI_IMMU, pm->pm_tsb);
|
||||
stxa(AA_DMMU_PCXR, ASI_DMMU, (ldxa(AA_DMMU_PCXR, ASI_DMMU) &
|
||||
TLB_CXR_PGSZ_MASK) | context);
|
||||
flush(KERNBASE);
|
||||
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
critical_exit();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1829,7 +1829,7 @@ gotit:
|
||||
}
|
||||
UFS_UNLOCK(ump);
|
||||
if (DOINGSOFTDEP(ITOV(ip)))
|
||||
softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref);
|
||||
softdep_setup_inomapdep(bp, ip, cg * fs->fs_ipg + ipref, mode);
|
||||
bdwrite(bp);
|
||||
if (ibp != NULL)
|
||||
bawrite(ibp);
|
||||
|
@ -130,7 +130,7 @@ void softdep_freefile(struct vnode *, ino_t, int);
|
||||
int softdep_request_cleanup(struct fs *, struct vnode *,
|
||||
struct ucred *, int);
|
||||
void softdep_setup_freeblocks(struct inode *, off_t, int);
|
||||
void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t);
|
||||
void softdep_setup_inomapdep(struct buf *, struct inode *, ino_t, int);
|
||||
void softdep_setup_blkmapdep(struct buf *, struct mount *, ufs2_daddr_t,
|
||||
int, int);
|
||||
void softdep_setup_allocdirect(struct inode *, ufs_lbn_t, ufs2_daddr_t,
|
||||
|
@ -142,10 +142,11 @@ softdep_setup_sbupdate(ump, fs, bp)
|
||||
}
|
||||
|
||||
void
|
||||
softdep_setup_inomapdep(bp, ip, newinum)
|
||||
softdep_setup_inomapdep(bp, ip, newinum, mode)
|
||||
struct buf *bp;
|
||||
struct inode *ip;
|
||||
ino_t newinum;
|
||||
int mode;
|
||||
{
|
||||
|
||||
panic("softdep_setup_inomapdep called");
|
||||
@ -789,6 +790,8 @@ static void diradd_inode_written(struct diradd *, struct inodedep *);
|
||||
static int handle_written_indirdep(struct indirdep *, struct buf *,
|
||||
struct buf**);
|
||||
static int handle_written_inodeblock(struct inodedep *, struct buf *);
|
||||
static int jnewblk_rollforward(struct jnewblk *, struct fs *, struct cg *,
|
||||
uint8_t *);
|
||||
static int handle_written_bmsafemap(struct bmsafemap *, struct buf *);
|
||||
static void handle_written_jaddref(struct jaddref *);
|
||||
static void handle_written_jremref(struct jremref *);
|
||||
@ -820,6 +823,8 @@ static void handle_allocindir_partdone(struct allocindir *);
|
||||
static void initiate_write_filepage(struct pagedep *, struct buf *);
|
||||
static void initiate_write_indirdep(struct indirdep*, struct buf *);
|
||||
static void handle_written_mkdir(struct mkdir *, int);
|
||||
static int jnewblk_rollback(struct jnewblk *, struct fs *, struct cg *,
|
||||
uint8_t *);
|
||||
static void initiate_write_bmsafemap(struct bmsafemap *, struct buf *);
|
||||
static void initiate_write_inodeblock_ufs1(struct inodedep *, struct buf *);
|
||||
static void initiate_write_inodeblock_ufs2(struct inodedep *, struct buf *);
|
||||
@ -935,6 +940,7 @@ static void wake_worklist(struct worklist *);
|
||||
static void wait_worklist(struct worklist *, char *);
|
||||
static void remove_from_worklist(struct worklist *);
|
||||
static void softdep_flush(void);
|
||||
static void softdep_flushjournal(struct mount *);
|
||||
static int softdep_speedup(void);
|
||||
static void worklist_speedup(void);
|
||||
static int journal_mount(struct mount *, struct fs *, struct ucred *);
|
||||
@ -3046,6 +3052,25 @@ jfsync_write(jfsync, jseg, data)
|
||||
rec->jt_extsize = jfsync->jfs_extsize;
|
||||
}
|
||||
|
||||
static void
|
||||
softdep_flushjournal(mp)
|
||||
struct mount *mp;
|
||||
{
|
||||
struct jblocks *jblocks;
|
||||
struct ufsmount *ump;
|
||||
|
||||
if ((mp->mnt_kern_flag & MNTK_SUJ) == 0)
|
||||
return;
|
||||
ump = VFSTOUFS(mp);
|
||||
jblocks = ump->softdep_jblocks;
|
||||
ACQUIRE_LOCK(&lk);
|
||||
while (ump->softdep_on_journal) {
|
||||
jblocks->jb_needseg = 1;
|
||||
softdep_process_journal(mp, NULL, MNT_WAIT);
|
||||
}
|
||||
FREE_LOCK(&lk);
|
||||
}
|
||||
|
||||
/*
|
||||
* Flush some journal records to disk.
|
||||
*/
|
||||
@ -4310,7 +4335,6 @@ softdep_setup_create(dp, ip)
|
||||
inoreflst);
|
||||
KASSERT(jaddref != NULL && jaddref->ja_parent == dp->i_number,
|
||||
("softdep_setup_create: No addref structure present."));
|
||||
jaddref->ja_mode = ip->i_mode;
|
||||
}
|
||||
softdep_prelink(dvp, NULL);
|
||||
FREE_LOCK(&lk);
|
||||
@ -4417,7 +4441,6 @@ softdep_setup_mkdir(dp, ip)
|
||||
KASSERT(jaddref->ja_parent == dp->i_number,
|
||||
("softdep_setup_mkdir: bad parent %d",
|
||||
jaddref->ja_parent));
|
||||
jaddref->ja_mode = ip->i_mode;
|
||||
TAILQ_INSERT_BEFORE(&jaddref->ja_ref, &dotaddref->ja_ref,
|
||||
if_deps);
|
||||
}
|
||||
@ -4637,10 +4660,11 @@ softdep_revert_rmdir(dp, ip)
|
||||
* Called just after updating the cylinder group block to allocate an inode.
|
||||
*/
|
||||
void
|
||||
softdep_setup_inomapdep(bp, ip, newinum)
|
||||
softdep_setup_inomapdep(bp, ip, newinum, mode)
|
||||
struct buf *bp; /* buffer for cylgroup block with inode map */
|
||||
struct inode *ip; /* inode related to allocation */
|
||||
ino_t newinum; /* new inode number being allocated */
|
||||
int mode;
|
||||
{
|
||||
struct inodedep *inodedep;
|
||||
struct bmsafemap *bmsafemap;
|
||||
@ -4657,7 +4681,7 @@ softdep_setup_inomapdep(bp, ip, newinum)
|
||||
* can be dependent on it.
|
||||
*/
|
||||
if (mp->mnt_kern_flag & MNTK_SUJ) {
|
||||
jaddref = newjaddref(ip, newinum, 0, 0, 0);
|
||||
jaddref = newjaddref(ip, newinum, 0, 0, mode);
|
||||
jaddref->ja_state |= NEWBLOCK;
|
||||
}
|
||||
|
||||
@ -5014,14 +5038,12 @@ jnewblk_merge(new, old, wkhd)
|
||||
if (jnewblk->jn_blkno != njnewblk->jn_blkno)
|
||||
panic("jnewblk_merge: Merging disparate blocks.");
|
||||
/*
|
||||
* The record may be rolled back in the cg update bits
|
||||
* appropriately. NEWBLOCK here alerts the cg rollback code
|
||||
* that the frag bits have changed.
|
||||
* The record may be rolled back in the cg.
|
||||
*/
|
||||
if (jnewblk->jn_state & UNDONE) {
|
||||
njnewblk->jn_state |= UNDONE | NEWBLOCK;
|
||||
njnewblk->jn_state &= ~ATTACHED;
|
||||
jnewblk->jn_state &= ~UNDONE;
|
||||
njnewblk->jn_state |= UNDONE;
|
||||
njnewblk->jn_state &= ~ATTACHED;
|
||||
}
|
||||
/*
|
||||
* We modify the newer addref and free the older so that if neither
|
||||
@ -10233,6 +10255,70 @@ softdep_setup_blkfree(mp, bp, blkno, frags, wkhd)
|
||||
FREE_LOCK(&lk);
|
||||
}
|
||||
|
||||
/*
|
||||
* Revert a block allocation when the journal record that describes it
|
||||
* is not yet written.
|
||||
*/
|
||||
int
|
||||
jnewblk_rollback(jnewblk, fs, cgp, blksfree)
|
||||
struct jnewblk *jnewblk;
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
uint8_t *blksfree;
|
||||
{
|
||||
ufs1_daddr_t fragno;
|
||||
long cgbno, bbase;
|
||||
int frags, blk;
|
||||
int i;
|
||||
|
||||
frags = 0;
|
||||
cgbno = dtogd(fs, jnewblk->jn_blkno);
|
||||
/*
|
||||
* We have to test which frags need to be rolled back. We may
|
||||
* be operating on a stale copy when doing background writes.
|
||||
*/
|
||||
for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++)
|
||||
if (isclr(blksfree, cgbno + i))
|
||||
frags++;
|
||||
if (frags == 0)
|
||||
return (0);
|
||||
/*
|
||||
* This is mostly ffs_blkfree() sans some validation and
|
||||
* superblock updates.
|
||||
*/
|
||||
if (frags == fs->fs_frag) {
|
||||
fragno = fragstoblks(fs, cgbno);
|
||||
ffs_setblock(fs, blksfree, fragno);
|
||||
ffs_clusteracct(fs, cgp, fragno, 1);
|
||||
cgp->cg_cs.cs_nbfree++;
|
||||
} else {
|
||||
cgbno += jnewblk->jn_oldfrags;
|
||||
bbase = cgbno - fragnum(fs, cgbno);
|
||||
/* Decrement the old frags. */
|
||||
blk = blkmap(fs, blksfree, bbase);
|
||||
ffs_fragacct(fs, blk, cgp->cg_frsum, -1);
|
||||
/* Deallocate the fragment */
|
||||
for (i = 0; i < frags; i++)
|
||||
setbit(blksfree, cgbno + i);
|
||||
cgp->cg_cs.cs_nffree += frags;
|
||||
/* Add back in counts associated with the new frags */
|
||||
blk = blkmap(fs, blksfree, bbase);
|
||||
ffs_fragacct(fs, blk, cgp->cg_frsum, 1);
|
||||
/* If a complete block has been reassembled, account for it. */
|
||||
fragno = fragstoblks(fs, bbase);
|
||||
if (ffs_isblock(fs, blksfree, fragno)) {
|
||||
cgp->cg_cs.cs_nffree -= fs->fs_frag;
|
||||
ffs_clusteracct(fs, cgp, fragno, 1);
|
||||
cgp->cg_cs.cs_nbfree++;
|
||||
}
|
||||
}
|
||||
stat_jnewblk++;
|
||||
jnewblk->jn_state &= ~ATTACHED;
|
||||
jnewblk->jn_state |= UNDONE;
|
||||
|
||||
return (frags);
|
||||
}
|
||||
|
||||
static void
|
||||
initiate_write_bmsafemap(bmsafemap, bp)
|
||||
struct bmsafemap *bmsafemap;
|
||||
@ -10244,10 +10330,7 @@ initiate_write_bmsafemap(bmsafemap, bp)
|
||||
uint8_t *blksfree;
|
||||
struct cg *cgp;
|
||||
struct fs *fs;
|
||||
int cleared;
|
||||
ino_t ino;
|
||||
long bno;
|
||||
int i;
|
||||
|
||||
if (bmsafemap->sm_state & IOSTARTED)
|
||||
panic("initiate_write_bmsafemap: Already started\n");
|
||||
@ -10286,25 +10369,9 @@ initiate_write_bmsafemap(bmsafemap, bp)
|
||||
fs = VFSTOUFS(bmsafemap->sm_list.wk_mp)->um_fs;
|
||||
blksfree = cg_blksfree(cgp);
|
||||
LIST_FOREACH(jnewblk, &bmsafemap->sm_jnewblkhd, jn_deps) {
|
||||
bno = dtogd(fs, jnewblk->jn_blkno);
|
||||
cleared = 0;
|
||||
for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags;
|
||||
i++) {
|
||||
if (isclr(blksfree, bno + i)) {
|
||||
cleared = 1;
|
||||
setbit(blksfree, bno + i);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* We may not clear the block if it's a background
|
||||
* copy. In that case there is no reason to detach
|
||||
* it.
|
||||
*/
|
||||
if (cleared) {
|
||||
stat_jnewblk++;
|
||||
jnewblk->jn_state &= ~ATTACHED;
|
||||
jnewblk->jn_state |= UNDONE;
|
||||
} else if ((bp->b_xflags & BX_BKGRDMARKER) == 0)
|
||||
if (jnewblk_rollback(jnewblk, fs, cgp, blksfree))
|
||||
continue;
|
||||
if ((bp->b_xflags & BX_BKGRDMARKER) == 0)
|
||||
panic("initiate_write_bmsafemap: block %jd "
|
||||
"marked free", jnewblk->jn_blkno);
|
||||
}
|
||||
@ -10578,6 +10645,9 @@ handle_jwork(wkhd)
|
||||
case D_FREEDEP:
|
||||
free_freedep(WK_FREEDEP(wk));
|
||||
continue;
|
||||
case D_FREEFRAG:
|
||||
rele_jseg(WK_JSEG(WK_FREEFRAG(wk)->ff_jdep));
|
||||
WORKITEM_FREE(wk, D_FREEFRAG);
|
||||
case D_FREEWORK:
|
||||
handle_written_freework(WK_FREEWORK(wk));
|
||||
continue;
|
||||
@ -11049,6 +11119,58 @@ bmsafemap_rollbacks(bmsafemap)
|
||||
!LIST_EMPTY(&bmsafemap->sm_jnewblkhd));
|
||||
}
|
||||
|
||||
/*
|
||||
* Re-apply an allocation when a cg write is complete.
|
||||
*/
|
||||
static int
|
||||
jnewblk_rollforward(jnewblk, fs, cgp, blksfree)
|
||||
struct jnewblk *jnewblk;
|
||||
struct fs *fs;
|
||||
struct cg *cgp;
|
||||
uint8_t *blksfree;
|
||||
{
|
||||
ufs1_daddr_t fragno;
|
||||
ufs2_daddr_t blkno;
|
||||
long cgbno, bbase;
|
||||
int frags, blk;
|
||||
int i;
|
||||
|
||||
frags = 0;
|
||||
cgbno = dtogd(fs, jnewblk->jn_blkno);
|
||||
for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags; i++) {
|
||||
if (isclr(blksfree, cgbno + i))
|
||||
panic("jnewblk_rollforward: re-allocated fragment");
|
||||
frags++;
|
||||
}
|
||||
if (frags == fs->fs_frag) {
|
||||
blkno = fragstoblks(fs, cgbno);
|
||||
ffs_clrblock(fs, blksfree, (long)blkno);
|
||||
ffs_clusteracct(fs, cgp, blkno, -1);
|
||||
cgp->cg_cs.cs_nbfree--;
|
||||
} else {
|
||||
bbase = cgbno - fragnum(fs, cgbno);
|
||||
cgbno += jnewblk->jn_oldfrags;
|
||||
/* If a complete block had been reassembled, account for it. */
|
||||
fragno = fragstoblks(fs, bbase);
|
||||
if (ffs_isblock(fs, blksfree, fragno)) {
|
||||
cgp->cg_cs.cs_nffree += fs->fs_frag;
|
||||
ffs_clusteracct(fs, cgp, fragno, -1);
|
||||
cgp->cg_cs.cs_nbfree--;
|
||||
}
|
||||
/* Decrement the old frags. */
|
||||
blk = blkmap(fs, blksfree, bbase);
|
||||
ffs_fragacct(fs, blk, cgp->cg_frsum, -1);
|
||||
/* Allocate the fragment */
|
||||
for (i = 0; i < frags; i++)
|
||||
clrbit(blksfree, cgbno + i);
|
||||
cgp->cg_cs.cs_nffree -= frags;
|
||||
/* Add back in counts associated with the new frags */
|
||||
blk = blkmap(fs, blksfree, bbase);
|
||||
ffs_fragacct(fs, blk, cgp->cg_frsum, 1);
|
||||
}
|
||||
return (frags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Complete a write to a bmsafemap structure. Roll forward any bitmap
|
||||
* changes if it's not a background write. Set all written dependencies
|
||||
@ -11069,9 +11191,7 @@ handle_written_bmsafemap(bmsafemap, bp)
|
||||
struct cg *cgp;
|
||||
struct fs *fs;
|
||||
ino_t ino;
|
||||
long bno;
|
||||
int chgs;
|
||||
int i;
|
||||
|
||||
if ((bmsafemap->sm_state & IOSTARTED) == 0)
|
||||
panic("initiate_write_bmsafemap: Not started\n");
|
||||
@ -11121,18 +11241,9 @@ handle_written_bmsafemap(bmsafemap, bp)
|
||||
jntmp) {
|
||||
if ((jnewblk->jn_state & UNDONE) == 0)
|
||||
continue;
|
||||
bno = dtogd(fs, jnewblk->jn_blkno);
|
||||
for (i = jnewblk->jn_oldfrags; i < jnewblk->jn_frags;
|
||||
i++) {
|
||||
if (bp->b_xflags & BX_BKGRDMARKER)
|
||||
break;
|
||||
if ((jnewblk->jn_state & NEWBLOCK) == 0 &&
|
||||
isclr(blksfree, bno + i))
|
||||
panic("handle_written_bmsafemap: "
|
||||
"re-allocated fragment");
|
||||
clrbit(blksfree, bno + i);
|
||||
if ((bp->b_xflags & BX_BKGRDMARKER) == 0 &&
|
||||
jnewblk_rollforward(jnewblk, fs, cgp, blksfree))
|
||||
chgs = 1;
|
||||
}
|
||||
jnewblk->jn_state &= ~(UNDONE | NEWBLOCK);
|
||||
jnewblk->jn_state |= ATTACHED;
|
||||
free_jnewblk(jnewblk);
|
||||
@ -11826,6 +11937,11 @@ softdep_sync_metadata(struct vnode *vp)
|
||||
* truncations are started, and inode references are journaled.
|
||||
*/
|
||||
ACQUIRE_LOCK(&lk);
|
||||
/*
|
||||
* Write all journal records to prevent rollbacks on devvp.
|
||||
*/
|
||||
if (vp->v_type == VCHR)
|
||||
softdep_flushjournal(vp->v_mount);
|
||||
error = flush_inodedep_deps(vp, vp->v_mount, VTOI(vp)->i_number);
|
||||
/*
|
||||
* Ensure that all truncates are written so we won't find deps on
|
||||
|
@ -1089,10 +1089,20 @@ vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t addr, vm_size_t len,
|
||||
* caller's changes may go unnoticed because they are
|
||||
* performed through an unmanaged mapping or by a DMA
|
||||
* operation.
|
||||
*
|
||||
* The object lock is not held here. Therefore, like
|
||||
* a pmap operation, the page queues lock may be
|
||||
* required in order to call vm_page_dirty(). See
|
||||
* vm_page_clear_dirty_mask().
|
||||
*/
|
||||
#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
|
||||
defined(__mips__)
|
||||
vm_page_dirty(*mp);
|
||||
#else
|
||||
vm_page_lock_queues();
|
||||
vm_page_dirty(*mp);
|
||||
vm_page_unlock_queues();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
if (pmap_failed) {
|
||||
|
@ -729,7 +729,12 @@ vm_page_sleep(vm_page_t m, const char *msg)
|
||||
/*
|
||||
* vm_page_dirty:
|
||||
*
|
||||
* make page all dirty
|
||||
* Set all bits in the page's dirty field.
|
||||
*
|
||||
* The object containing the specified page must be locked if the call is
|
||||
* made from the machine-independent layer. If, however, the call is
|
||||
* made from the pmap layer, then the page queues lock may be required.
|
||||
* See vm_page_clear_dirty_mask().
|
||||
*/
|
||||
void
|
||||
vm_page_dirty(vm_page_t m)
|
||||
@ -2325,15 +2330,41 @@ vm_page_clear_dirty_mask(vm_page_t m, int pagebits)
|
||||
/*
|
||||
* If the object is locked and the page is neither VPO_BUSY nor
|
||||
* PG_WRITEABLE, then the page's dirty field cannot possibly be
|
||||
* modified by a concurrent pmap operation.
|
||||
* set by a concurrent pmap operation.
|
||||
*/
|
||||
VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED);
|
||||
if ((m->oflags & VPO_BUSY) == 0 && (m->flags & PG_WRITEABLE) == 0)
|
||||
m->dirty &= ~pagebits;
|
||||
else {
|
||||
#if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || \
|
||||
defined(__mips__)
|
||||
/*
|
||||
* On the aforementioned architectures, the page queues lock
|
||||
* is not required by the following read-modify-write
|
||||
* operation. The combination of the object's lock and an
|
||||
* atomic operation suffice. Moreover, the pmap layer on
|
||||
* these architectures can call vm_page_dirty() without
|
||||
* holding the page queues lock.
|
||||
*/
|
||||
#if PAGE_SIZE == 4096
|
||||
atomic_clear_char(&m->dirty, pagebits);
|
||||
#elif PAGE_SIZE == 8192
|
||||
atomic_clear_short(&m->dirty, pagebits);
|
||||
#elif PAGE_SIZE == 16384
|
||||
atomic_clear_int(&m->dirty, pagebits);
|
||||
#else
|
||||
#error "PAGE_SIZE is not supported."
|
||||
#endif
|
||||
#else
|
||||
/*
|
||||
* Otherwise, the page queues lock is required to ensure that
|
||||
* a concurrent pmap operation does not set the page's dirty
|
||||
* field during the following read-modify-write operation.
|
||||
*/
|
||||
vm_page_lock_queues();
|
||||
m->dirty &= ~pagebits;
|
||||
vm_page_unlock_queues();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,10 +89,26 @@
|
||||
* and offset to which this page belongs (for pageout),
|
||||
* and sundry status bits.
|
||||
*
|
||||
* Fields in this structure are locked either by the lock on the
|
||||
* object that the page belongs to (O), its corresponding page lock (P),
|
||||
* or by the lock on the page queues (Q).
|
||||
*
|
||||
* In general, operations on this structure's mutable fields are
|
||||
* synchronized using either one of or a combination of the lock on the
|
||||
* object that the page belongs to (O), the pool lock for the page (P),
|
||||
* or the lock for either the free or paging queues (Q). If a field is
|
||||
* annotated below with two of these locks, then holding either lock is
|
||||
* sufficient for read access, but both locks are required for write
|
||||
* access.
|
||||
*
|
||||
* In contrast, the synchronization of accesses to the page's dirty field
|
||||
* is machine dependent (M). In the machine-independent layer, the lock
|
||||
* on the object that the page belongs to must be held in order to
|
||||
* operate on the field. However, the pmap layer is permitted to set
|
||||
* all bits within the field without holding that lock. Therefore, if
|
||||
* the underlying architecture does not support atomic read-modify-write
|
||||
* operations on the field's type, then the machine-independent layer
|
||||
* must also hold the page queues lock when performing read-modify-write
|
||||
* operations and the pmap layer must hold the page queues lock when
|
||||
* setting the field. In the machine-independent layer, the
|
||||
* implementation of read-modify-write operations on the field is
|
||||
* encapsulated in vm_page_clear_dirty_mask().
|
||||
*/
|
||||
|
||||
TAILQ_HEAD(pglist, vm_page);
|
||||
@ -120,18 +136,19 @@ struct vm_page {
|
||||
u_char busy; /* page busy count (O) */
|
||||
/* NOTE that these must support one bit per DEV_BSIZE in a page!!! */
|
||||
/* so, on normal X86 kernels, they must be at least 8 bits wide */
|
||||
/* In reality, support for 32KB pages is not fully implemented. */
|
||||
#if PAGE_SIZE == 4096
|
||||
u_char valid; /* map of valid DEV_BSIZE chunks (O) */
|
||||
u_char dirty; /* map of dirty DEV_BSIZE chunks (O) */
|
||||
u_char dirty; /* map of dirty DEV_BSIZE chunks (M) */
|
||||
#elif PAGE_SIZE == 8192
|
||||
u_short valid; /* map of valid DEV_BSIZE chunks (O) */
|
||||
u_short dirty; /* map of dirty DEV_BSIZE chunks (O) */
|
||||
u_short dirty; /* map of dirty DEV_BSIZE chunks (M) */
|
||||
#elif PAGE_SIZE == 16384
|
||||
u_int valid; /* map of valid DEV_BSIZE chunks (O) */
|
||||
u_int dirty; /* map of dirty DEV_BSIZE chunks (O) */
|
||||
u_int dirty; /* map of dirty DEV_BSIZE chunks (M) */
|
||||
#elif PAGE_SIZE == 32768
|
||||
u_long valid; /* map of valid DEV_BSIZE chunks (O) */
|
||||
u_long dirty; /* map of dirty DEV_BSIZE chunks (O) */
|
||||
u_long dirty; /* map of dirty DEV_BSIZE chunks (M) */
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -8,18 +8,18 @@
|
||||
#
|
||||
#CFLAGS+=-DGATE_SERVER=\"ftp-gw.host\" # -DGATE_PORT=21
|
||||
|
||||
LUKEMFTP= ${.CURDIR}/../../contrib/lukemftp
|
||||
.PATH: ${LUKEMFTP}/src
|
||||
TNFTP= ${.CURDIR}/../../contrib/tnftp
|
||||
.PATH: ${TNFTP}/src
|
||||
|
||||
PROG= ftp
|
||||
SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c progressbar.c \
|
||||
ruserpass.c util.c
|
||||
SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \
|
||||
progressbar.c ruserpass.c util.c
|
||||
|
||||
.if ${MK_INET6_SUPPORT} != "no"
|
||||
CFLAGS+= -DINET6
|
||||
.endif
|
||||
|
||||
CFLAGS+= -I${.CURDIR} -I${LUKEMFTP}
|
||||
CFLAGS+= -I${.CURDIR} -I${TNFTP}
|
||||
LDADD= -ledit -ltermcap -lutil
|
||||
DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL}
|
||||
|
||||
|
@ -1,285 +0,0 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* $Id: config.h.in,v 1.24 2000/09/18 00:40:12 lukem Exp $ */
|
||||
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
/* #undef _ALL_SOURCE */
|
||||
#endif
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
#define GETPGRP_VOID 1
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
/* #undef NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
|
||||
/* #undef F77_NO_MINUS_C_MINUS_O */
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to the type of arg1 for select(). */
|
||||
/* #undef SELECT_TYPE_ARG1 */
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for select(). */
|
||||
/* #undef SELECT_TYPE_ARG234 */
|
||||
|
||||
/* Define to the type of arg5 for select(). */
|
||||
/* #undef SELECT_TYPE_ARG5 */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef VOID_CLOSEDIR */
|
||||
|
||||
/* The number of bytes in a off_t. */
|
||||
#define SIZEOF_OFF_T 0
|
||||
|
||||
/* Define if you have the err function. */
|
||||
#define HAVE_ERR 1
|
||||
|
||||
/* Define if you have the fgetln function. */
|
||||
#define HAVE_FGETLN 1
|
||||
|
||||
/* Define if you have the fparseln function. */
|
||||
#define HAVE_FPARSELN 1
|
||||
|
||||
/* Define if you have the fseeko function. */
|
||||
#define HAVE_FSEEKO 1
|
||||
|
||||
/* Define if you have the getaddrinfo function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define if you have the gethostbyname2 function. */
|
||||
#define HAVE_GETHOSTBYNAME2 1
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define if you have the getpassphrase function. */
|
||||
/* #undef HAVE_GETPASSPHRASE */
|
||||
|
||||
/* Define if you have the getpgrp function. */
|
||||
#define HAVE_GETPGRP 1
|
||||
|
||||
/* Define if you have the glob function. */
|
||||
#define USE_GLOB_H 1
|
||||
|
||||
/* Define if you have the inet_ntop function. */
|
||||
#define HAVE_INET_NTOP 1
|
||||
|
||||
/* Define if you have the inet_pton function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
|
||||
/* Define if you have the issetugid function. */
|
||||
#define HAVE_ISSETUGID 1
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
#define HAVE_MKSTEMP 1
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the setprogname function. */
|
||||
#define HAVE_SETPROGNAME 1
|
||||
|
||||
/* Define if you have the sl_init function. */
|
||||
#define HAVE_SL_INIT 1
|
||||
|
||||
/* Define if you have the snprintf function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strlcat function. */
|
||||
#define HAVE_STRLCAT 1
|
||||
|
||||
/* Define if you have the strlcpy function. */
|
||||
#define HAVE_STRLCPY 1
|
||||
|
||||
/* Define if you have the strptime function. */
|
||||
#define HAVE_STRPTIME 1
|
||||
|
||||
/* Define if you have the strsep function. */
|
||||
#define HAVE_STRSEP 1
|
||||
|
||||
/* Define if you have the strtoll function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Define if you have the strunvis function. */
|
||||
#define HAVE_STRUNVIS 1
|
||||
|
||||
/* Define if you have the strvis function. */
|
||||
#define HAVE_STRVIS 1
|
||||
|
||||
/* Define if you have the timegm function. */
|
||||
#define HAVE_TIMEGM 1
|
||||
|
||||
/* Define if you have the usleep function. */
|
||||
#define HAVE_USLEEP 1
|
||||
|
||||
/* Define if you have the <arpa/nameser.h> header file. */
|
||||
#define HAVE_ARPA_NAMESER_H 1
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define if you have the <err.h> header file. */
|
||||
#define HAVE_ERR_H 1
|
||||
|
||||
/* Define if you have the <libutil.h> header file. */
|
||||
#define HAVE_LIBUTIL_H 1
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <paths.h> header file. */
|
||||
#define HAVE_PATHS_H 1
|
||||
|
||||
/* Define if you have the <poll.h> header file. */
|
||||
#define HAVE_POLL_H 1
|
||||
|
||||
/* Define if you have the <regex.h> header file. */
|
||||
#define HAVE_REGEX_H 1
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
#define HAVE_SYS_DIR_H 1
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/poll.h> header file. */
|
||||
#define HAVE_SYS_POLL_H 1
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
#define HAVE_TERMCAP_H 1
|
||||
|
||||
/* Define if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define if you have the <vis.h> header file. */
|
||||
#define HAVE_VIS_H 1
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
/* #undef HAVE_LIBNSL */
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Define if you have the tinfo library (-ltinfo). */
|
||||
#define HAVE_LIBTINFO 1
|
||||
|
||||
/* Define if you have the util library (-lutil). */
|
||||
#define HAVE_LIBUTIL 1
|
||||
|
||||
/* Define if your compiler supports `long long' */
|
||||
#define HAVE_LONG_LONG 1
|
||||
|
||||
/* Define if in_port_t exists */
|
||||
#define HAVE_IN_PORT_T 1
|
||||
|
||||
/* Define if sa_family_t exists in <sys/socket.h> */
|
||||
#define HAVE_SA_FAMILY_T 1
|
||||
|
||||
/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */
|
||||
#define HAVE_SOCKADDR_SA_LEN 1
|
||||
|
||||
/* Define if socklen_t exists */
|
||||
#define HAVE_SOCKLEN_T 1
|
||||
|
||||
/* Define if AF_INET6 exists in <sys/socket.h> */
|
||||
#define HAVE_AF_INET6 1
|
||||
|
||||
/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */
|
||||
#define HAVE_SOCKADDR_IN6 1
|
||||
|
||||
/* Define if `struct addrinfo' exists in <netdb.h> */
|
||||
#define HAVE_ADDRINFO 1
|
||||
|
||||
/*
|
||||
* Define if <netdb.h> contains AI_NUMERICHOST et al.
|
||||
* Systems which only implement RFC2133 will need this.
|
||||
*/
|
||||
#define HAVE_RFC2553_NETDB 1
|
||||
|
||||
/* Define if `struct direct' has a d_namlen element */
|
||||
#define HAVE_D_NAMLEN 1
|
||||
|
||||
/* Define if GLOB_BRACE exists in <glob.h> */
|
||||
#define HAVE_GLOB_BRACE 1
|
||||
|
||||
/* Define if h_errno exists in <netdb.h> */
|
||||
#define HAVE_H_ERRNO_D 1
|
||||
|
||||
/* Define if fclose() is declared in <stdio.h> */
|
||||
#define HAVE_FCLOSE_D 1
|
||||
|
||||
/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */
|
||||
#define HAVE_GETPASS_D 1
|
||||
|
||||
/* Define if optarg is declared in <stdlib.h> or <unistd.h> */
|
||||
#define HAVE_OPTARG_D 1
|
||||
|
||||
/* Define if optind is declared in <stdlib.h> or <unistd.h> */
|
||||
#define HAVE_OPTIND_D 1
|
||||
|
||||
/* Define if pclose() is declared in <stdio.h> */
|
||||
#define HAVE_PCLOSE_D 1
|
||||
|
||||
/* Define if `long long' is supported and sizeof(off_t) >= 8 */
|
||||
#define HAVE_QUAD_SUPPORT 1
|
||||
|
||||
/* Define if strptime() is declared in <time.h> */
|
||||
#define HAVE_STRPTIME_D 1
|
||||
|
||||
/*
|
||||
* Define this if compiling with SOCKS (the firewall traversal library).
|
||||
* Also, you must define connect, getsockname, bind, accept, listen, and
|
||||
* select to their R-versions.
|
||||
*/
|
||||
/* #undef SOCKS */
|
||||
/* #undef SOCKS4 */
|
||||
/* #undef SOCKS5 */
|
||||
/* #undef connect */
|
||||
/* #undef getsockname */
|
||||
/* #undef bind */
|
||||
/* #undef accept */
|
||||
/* #undef listen */
|
||||
/* #undef select */
|
||||
/* #undef dup */
|
||||
/* #undef dup2 */
|
||||
/* #undef fclose */
|
||||
/* #undef gethostbyname */
|
||||
/* #undef getpeername */
|
||||
/* #undef read */
|
||||
/* #undef recv */
|
||||
/* #undef recvfrom */
|
||||
/* #undef rresvport */
|
||||
/* #undef send */
|
||||
/* #undef sendto */
|
||||
/* #undef shutdown */
|
||||
/* #undef write */
|
514
usr.bin/ftp/tnftp_config.h
Normal file
514
usr.bin/ftp/tnftp_config.h
Normal file
@ -0,0 +1,514 @@
|
||||
/* $FreeBSD$ */
|
||||
/* tnftp_config.h. Generated from tnftp_config.h.in by configure. */
|
||||
/* tnftp_config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if the `closedir' function returns void instead of `int'. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define to 1 if the `getpgrp' function requires zero arguments. */
|
||||
#define GETPGRP_VOID 1
|
||||
|
||||
/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */
|
||||
/* #undef GWINSZ_IN_SYS_IOCTL */
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
/* #undef HAVE_ALLOCA_H */
|
||||
|
||||
/* Define to 1 if you have the <arpa/ftp.h> header file. */
|
||||
#define HAVE_ARPA_FTP_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/nameser.h> header file. */
|
||||
#define HAVE_ARPA_NAMESER_H 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `AF_INET6', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_AF_INET6 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `AI_NUMERICHOST', and to 0 if
|
||||
you don't. */
|
||||
#define HAVE_DECL_AI_NUMERICHOST 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `dirname', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_DIRNAME 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `fclose', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_FCLOSE 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `getpass', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_GETPASS 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_H_ERRNO 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `NS_IN6ADDRSZ', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_NS_IN6ADDRSZ 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_OPTARG 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `optind', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_OPTIND 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `pclose', and to 0 if you don't.
|
||||
*/
|
||||
#define HAVE_DECL_PCLOSE 1
|
||||
|
||||
/* Define to 1 if you have the declaration of `strptime', and to 0 if you
|
||||
don't. */
|
||||
#define HAVE_DECL_STRPTIME 1
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define to 1 if you have the `dirname' function. */
|
||||
#define HAVE_DIRNAME 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `err' function. */
|
||||
#define HAVE_ERR 1
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
#define HAVE_ERR_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `fgetln' function. */
|
||||
#define HAVE_FGETLN 1
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#define HAVE_FORK 1
|
||||
|
||||
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
|
||||
#define HAVE_FSEEKO 1
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define to 1 if you have the `getcwd' function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyaddr' function. */
|
||||
#define HAVE_GETHOSTBYADDR 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname' function. */
|
||||
#define HAVE_GETHOSTBYNAME 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname2' function. */
|
||||
#define HAVE_GETHOSTBYNAME2 1
|
||||
|
||||
/* Define to 1 if you have the `gethostname' function. */
|
||||
#define HAVE_GETHOSTNAME 1
|
||||
|
||||
/* Define to 1 if you have the `getnameinfo' function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define to 1 if you have the `getpass' function. */
|
||||
#define HAVE_GETPASS 1
|
||||
|
||||
/* Define to 1 if you have the `getpassphrase' function. */
|
||||
/* #undef HAVE_GETPASSPHRASE */
|
||||
|
||||
/* Define to 1 if you have the `getpgrp' function. */
|
||||
#define HAVE_GETPGRP 1
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
#define HAVE_GETTIMEOFDAY 1
|
||||
|
||||
/* Define to 1 if you have the `inet_ntop' function. */
|
||||
#define HAVE_INET_NTOP 1
|
||||
|
||||
/* Define to 1 if you have the `inet_pton' function. */
|
||||
#define HAVE_INET_PTON 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if the system has the type `in_port_t'. */
|
||||
#define HAVE_IN_PORT_T 1
|
||||
|
||||
/* Define to 1 if you have the `isascii' function. */
|
||||
#define HAVE_ISASCII 1
|
||||
|
||||
/* Define to 1 if you have the <libgen.h> header file. */
|
||||
#define HAVE_LIBGEN_H 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if the system has the type `long double'. */
|
||||
#define HAVE_LONG_DOUBLE 1
|
||||
|
||||
/* Define to 1 if the system has the type `long long int'. */
|
||||
#define HAVE_LONG_LONG_INT 1
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
/* #undef HAVE_MALLOC_H */
|
||||
|
||||
/* Define to 1 if you have the `memchr' function. */
|
||||
#define HAVE_MEMCHR 1
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `memset' function. */
|
||||
#define HAVE_MEMSET 1
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
#define HAVE_MKSTEMP 1
|
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
#define HAVE_NETDB_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/in_systm.h> header file. */
|
||||
#define HAVE_NETINET_IN_SYSTM_H 1
|
||||
|
||||
/* Define to 1 if you have the <netinet/ip.h> header file. */
|
||||
#define HAVE_NETINET_IP_H 1
|
||||
|
||||
/* Define to 1 if you have the <paths.h> header file. */
|
||||
#define HAVE_PATHS_H 1
|
||||
|
||||
/* Define if we have poll() and it is not emulated. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the <poll.h> header file. */
|
||||
#define HAVE_POLL_H 1
|
||||
|
||||
/* Define if `long long' is supported and *printf() supports %lld or %qd to
|
||||
print them. */
|
||||
#define HAVE_PRINTF_LONG_LONG 1
|
||||
|
||||
/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld). */
|
||||
/* #undef HAVE_PRINTF_QD */
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H 1
|
||||
|
||||
/* Define to 1 if you have the `realpath' function. */
|
||||
#define HAVE_REALPATH 1
|
||||
|
||||
/* Define to 1 if you have the `regcomp' function. */
|
||||
#define HAVE_REGCOMP 1
|
||||
|
||||
/* Define to 1 if you have the <regex.h> header file. */
|
||||
#define HAVE_REGEX_H 1
|
||||
|
||||
/* Define to 1 if you have the <resolv.h> header file. */
|
||||
#define HAVE_RESOLV_H 1
|
||||
|
||||
/* Define to 1 if the system has the type `sa_family_t'. */
|
||||
#define HAVE_SA_FAMILY_T 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the <setjmp.h> header file. */
|
||||
#define HAVE_SETJMP_H 1
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if you have the `setprogname' function. */
|
||||
#define HAVE_SETPROGNAME 1
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if you have the `sl_init' function. */
|
||||
#define HAVE_SL_INIT 1
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if the system has the type `socklen_t'. */
|
||||
#define HAVE_SOCKLEN_T 1
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `strchr' function. */
|
||||
#define HAVE_STRCHR 1
|
||||
|
||||
/* Define to 1 if you have the `strcoll' function and it is properly defined.
|
||||
*/
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define to 1 if you have the `strcspn' function. */
|
||||
#define HAVE_STRCSPN 1
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#define HAVE_STRDUP 1
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strlcat' function. */
|
||||
#define HAVE_STRLCAT 1
|
||||
|
||||
/* Define to 1 if you have the `strlcpy' function. */
|
||||
#define HAVE_STRLCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strncasecmp' function. */
|
||||
#define HAVE_STRNCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `strpbrk' function. */
|
||||
#define HAVE_STRPBRK 1
|
||||
|
||||
/* Define to 1 if you have the `strptime' function. */
|
||||
#define HAVE_STRPTIME 1
|
||||
|
||||
/* Define to 1 if you have the `strrchr' function. */
|
||||
#define HAVE_STRRCHR 1
|
||||
|
||||
/* Define to 1 if you have the `strsep' function. */
|
||||
#define HAVE_STRSEP 1
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the `strtol' function. */
|
||||
#define HAVE_STRTOL 1
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Define to 1 if you have the `strtoul' function. */
|
||||
#define HAVE_STRTOUL 1
|
||||
|
||||
/* Define to 1 if the system has the type `struct addrinfo'. */
|
||||
#define HAVE_STRUCT_ADDRINFO 1
|
||||
|
||||
/* Define to 1 if `struct dirent' is a member of `d_namlen'. */
|
||||
#define HAVE_STRUCT_DIRENT_D_NAMLEN 1
|
||||
|
||||
/* Define to 1 if the system has the type `struct pollfd'. */
|
||||
#define HAVE_STRUCT_POLLFD 1
|
||||
|
||||
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
|
||||
#define HAVE_STRUCT_SOCKADDR_IN6 1
|
||||
|
||||
/* Define to 1 if `struct sockaddr_in' is a member of `sin_len'. */
|
||||
#define HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
|
||||
|
||||
/* Define to 1 if `struct sockaddr' is a member of `sa_len'. */
|
||||
#define HAVE_STRUCT_SOCKADDR_SA_LEN 1
|
||||
|
||||
/* Define to 1 if you have the `strunvis' function. */
|
||||
#define HAVE_STRUNVIS 1
|
||||
|
||||
/* Define to 1 if you have the `strvis' function. */
|
||||
#define HAVE_STRVIS 1
|
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
/* #undef HAVE_SYS_DIR_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#define HAVE_SYS_PARAM_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/poll.h> header file. */
|
||||
#define HAVE_SYS_POLL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/syslimits.h> header file. */
|
||||
#define HAVE_SYS_SYSLIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#define HAVE_SYS_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/wait.h> header file. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define to 1 if you have the <termcap.h> header file. */
|
||||
#define HAVE_TERMCAP_H 1
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the `timegm' function. */
|
||||
#define HAVE_TIMEGM 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `usleep' function. */
|
||||
#define HAVE_USLEEP 1
|
||||
|
||||
/* Define to 1 if you have the `utime' function. */
|
||||
#define HAVE_UTIME 1
|
||||
|
||||
/* Define to 1 if you have the `utimes' function. */
|
||||
#define HAVE_UTIMES 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define to 1 if you have the `vfork' function. */
|
||||
#define HAVE_VFORK 1
|
||||
|
||||
/* Define to 1 if you have the <vfork.h> header file. */
|
||||
/* #undef HAVE_VFORK_H */
|
||||
|
||||
/* Define to 1 if you have the <vis.h> header file. */
|
||||
#define HAVE_VIS_H 1
|
||||
|
||||
/* Define to 1 if `fork' works. */
|
||||
#define HAVE_WORKING_FORK 1
|
||||
|
||||
/* Define to 1 if `vfork' works. */
|
||||
#define HAVE_WORKING_VFORK 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "tnftp"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT "lukem@NetBSD.org"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "tnftp"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "tnftp 20100108"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "tnftp"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "20100108"
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
/* #undef STACK_DIRECTION */
|
||||
|
||||
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define if using (Dante) SOCKS5 proxy. */
|
||||
/* #undef USE_SOCKS */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "20100108"
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
|
||||
/* #undef _LARGEFILE_SOURCE */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
|
||||
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
|
||||
#define below would cause a syntax error. */
|
||||
/* #undef _UINT32_T */
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `int' if <sys/types.h> does not define. */
|
||||
/* #undef pid_t */
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define to the type of an unsigned integer type of width exactly 32 bits if
|
||||
such a type exists and the standard includes do not define it. */
|
||||
/* #undef uint32_t */
|
||||
|
||||
/* Define as `fork' if `vfork' does not work. */
|
||||
/* #undef vfork */
|
||||
|
||||
|
||||
/* Define if using IPv6 support. */
|
||||
/* Commented out so this can be selected fromt he Makefile -gavin */
|
||||
/* #define USE_INET6 1 */
|
||||
|
||||
#define USE_GLOB_H 1
|
@ -7,6 +7,7 @@ CFLAGS+=-I${.CURDIR}
|
||||
SRCS= cd9660.c ffs.c \
|
||||
getid.c \
|
||||
makefs.c \
|
||||
mtree.c \
|
||||
walk.c
|
||||
MAN= makefs.8
|
||||
|
||||
@ -26,4 +27,7 @@ SRCS+= misc.c spec.c
|
||||
.PATH: ${.CURDIR}/../../sys/ufs/ffs
|
||||
SRCS+= ffs_tables.c
|
||||
|
||||
DPADD= ${LIBSBUF}
|
||||
LDADD= -lsbuf
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -294,10 +294,12 @@ cd9660_write_file(FILE *fd, cd9660node *writenode)
|
||||
INODE_WARNX(("%s: writing inode %d blocks at %" PRIu32,
|
||||
__func__, (int)inode->st.st_ino, inode->ino));
|
||||
inode->flags |= FI_WRITTEN;
|
||||
cd9660_compute_full_filename(writenode,
|
||||
temp_file_name, 0);
|
||||
if (writenode->node->contents == NULL)
|
||||
cd9660_compute_full_filename(writenode,
|
||||
temp_file_name, 0);
|
||||
ret = cd9660_copy_file(fd, writenode->fileDataSector,
|
||||
temp_file_name);
|
||||
(writenode->node->contents != NULL) ?
|
||||
writenode->node->contents : temp_file_name);
|
||||
if (ret == 0)
|
||||
goto out;
|
||||
}
|
||||
|
@ -776,9 +776,11 @@ ffs_populate_dir(const char *dir, fsnode *root, fsinfo_t *fsopts)
|
||||
continue; /* skip hard-linked entries */
|
||||
cur->inode->flags |= FI_WRITTEN;
|
||||
|
||||
if (snprintf(path, sizeof(path), "%s/%s", dir, cur->name)
|
||||
>= sizeof(path))
|
||||
errx(1, "Pathname too long.");
|
||||
if (cur->contents == NULL) {
|
||||
if (snprintf(path, sizeof(path), "%s/%s", dir,
|
||||
cur->name) >= sizeof(path))
|
||||
errx(1, "Pathname too long.");
|
||||
}
|
||||
|
||||
if (cur->child != NULL)
|
||||
continue; /* child creates own inode */
|
||||
@ -802,7 +804,8 @@ ffs_populate_dir(const char *dir, fsnode *root, fsinfo_t *fsopts)
|
||||
if (membuf != NULL) {
|
||||
ffs_write_file(&din, cur->inode->ino, membuf, fsopts);
|
||||
} else if (S_ISREG(cur->type)) {
|
||||
ffs_write_file(&din, cur->inode->ino, path, fsopts);
|
||||
ffs_write_file(&din, cur->inode->ino,
|
||||
(cur->contents) ? cur->contents : path, fsopts);
|
||||
} else {
|
||||
assert (! S_ISDIR(cur->type));
|
||||
ffs_write_inode(&din, cur->inode->ino, fsopts);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user