mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
Remove ftpd(8)
This was previously deprecated and is slated for removal in 15.0. Users who still need ftpd(8) can install the ftp/freebsd-ftpd port. Retain the ftp(d) PAM services since other FTP daemons use them. Update /etc/inetd.conf to point to /usr/local. Add ftpd to ObsoleteFiles, but do not list configuration files since users may want to preserve these to use with the freebsd-ftpd port. There is still some language in the manual referring to ftpd(8) which is relevant to the port, which has been retained but updated to reference the port. MFC after: 3 days Relnotes: yes Reviewed by: cperciva Differential Revision: https://reviews.freebsd.org/D52739
This commit is contained in:
parent
4e7a375804
commit
614c8750ce
38 changed files with 32 additions and 6972 deletions
|
|
@ -51,6 +51,12 @@
|
|||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20250929: Remove ftpd(8)
|
||||
OLD_FILES+=etc/rc.d/ftpd
|
||||
OLD_FILES+=usr/libexec/ftpd
|
||||
OLD_FILES+=usr/share/man/man5/ftpchroot.5.gz
|
||||
OLD_FILES+=usr/share/man/man8/ftpd.8.gz
|
||||
|
||||
# 20250917: VREF macro removed
|
||||
OLD_FILES+=usr/share/man/man9/VREF.9.gz
|
||||
|
||||
|
|
|
|||
5
UPDATING
5
UPDATING
|
|
@ -27,6 +27,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW:
|
|||
world, or to merely disable the most expensive debugging functionality
|
||||
at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".)
|
||||
|
||||
20250929:
|
||||
The deprecated ftpd(8) has been removed. Users who still need ftpd
|
||||
can install the ftp/freebsd-ftpd port. pkgbase users should remove
|
||||
the orphaned FreeBSD-ftpd package.
|
||||
|
||||
20250923:
|
||||
Several changes which affect pkgbase users (only):
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
.\"
|
||||
.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
|
||||
.\"
|
||||
.Dd May 10, 2008
|
||||
.Dd September 25, 2025
|
||||
.Dt FTP 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -2325,8 +2325,7 @@ for an example of how to make this automatic.
|
|||
.Sh SEE ALSO
|
||||
.Xr getservbyname 3 ,
|
||||
.Xr editrc 5 ,
|
||||
.Xr services 5 ,
|
||||
.Xr ftpd 8
|
||||
.Xr services 5
|
||||
.Sh STANDARDS
|
||||
.Nm
|
||||
attempts to be compliant with:
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
.\" 5. Modifications may be freely made to this file providing the above
|
||||
.\" conditions are met.
|
||||
.\"
|
||||
.Dd June 28, 2023
|
||||
.Dd September 25, 2025
|
||||
.Dt LOGIN.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -496,7 +496,7 @@ lists.
|
|||
.Xr pam 3 ,
|
||||
.Xr passwd 5 ,
|
||||
.Xr ttys 5 ,
|
||||
.Xr ftpd 8 ,
|
||||
.Xr ftpd 8 Pq Pa ports/ftp/freebsd-ftpd ,
|
||||
.Xr pam_passwdqc 8
|
||||
.Sh HISTORY
|
||||
The file
|
||||
|
|
|
|||
|
|
@ -54,10 +54,6 @@ SUBDIR+= fingerd
|
|||
_phttpget= phttpget
|
||||
.endif
|
||||
|
||||
.if ${MK_FTP} != "no"
|
||||
SUBDIR+= ftpd
|
||||
.endif
|
||||
|
||||
.if ${MK_MAIL} != "no"
|
||||
_comsat= comsat
|
||||
.endif
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
.include <src.opts.mk>
|
||||
|
||||
PACKAGE= ftpd
|
||||
|
||||
CONFS= ftpusers
|
||||
PROG= ftpd
|
||||
MAN= ftpd.8 ftpchroot.5
|
||||
SRCS= ftpd.c ftpcmd.y logwtmp.c popen.c
|
||||
|
||||
CFLAGS+=-DSETPROCTITLE -DLOGIN_CAP -DVIRTUAL_HOSTING
|
||||
CFLAGS+=-I${.CURDIR}
|
||||
YFLAGS=
|
||||
WARNS?= 2
|
||||
WFORMAT=0
|
||||
|
||||
LIBADD= crypt md util
|
||||
|
||||
.PATH: ${SRCTOP}/bin/ls
|
||||
SRCS+= ls.c cmp.c print.c util.c
|
||||
CFLAGS+=-Dmain=ls_main -I${SRCTOP}/bin/ls
|
||||
LIBADD+= m
|
||||
|
||||
.if ${MK_BLACKLIST_SUPPORT} != "no"
|
||||
CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blocklist/include
|
||||
SRCS+= blacklist.c
|
||||
LIBADD+= blacklist
|
||||
LDFLAGS+=-L${LIBBLACKLISTDIR}
|
||||
.endif
|
||||
|
||||
.if ${MK_INET6_SUPPORT} != "no"
|
||||
CFLAGS+=-DINET6
|
||||
.endif
|
||||
|
||||
.if ${MK_PAM_SUPPORT} != "no"
|
||||
CFLAGS+=-DUSE_PAM
|
||||
LIBADD+= pam
|
||||
.endif
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Autogenerated - do NOT edit!
|
||||
|
||||
DIRDEPS = \
|
||||
include \
|
||||
include/arpa \
|
||||
include/xlocale \
|
||||
lib/${CSU_DIR} \
|
||||
lib/libc \
|
||||
lib/libcompiler_rt \
|
||||
lib/libcrypt \
|
||||
lib/libmd \
|
||||
lib/libutil \
|
||||
lib/msun \
|
||||
usr.bin/yacc.host \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
||||
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
|
||||
# local dependencies - needed for -jN in clean tree
|
||||
.endif
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# This file is not autogenerated - take care!
|
||||
|
||||
DIRDEPS_OPTIONS= BLACKLIST_SUPPORT PAM_SUPPORT
|
||||
|
||||
.include <dirdeps-options.mk>
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
/*-
|
||||
* Copyright (c) 2016 The FreeBSD Foundation
|
||||
*
|
||||
* This software was developed by Kurt Lidl under sponsorship from the
|
||||
* FreeBSD Foundation.
|
||||
*
|
||||
* 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE. */
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <blacklist.h>
|
||||
#include "blacklist_client.h"
|
||||
|
||||
static struct blacklist *blstate;
|
||||
extern int use_blacklist;
|
||||
|
||||
void
|
||||
blacklist_init(void)
|
||||
{
|
||||
|
||||
if (use_blacklist)
|
||||
blstate = blacklist_open();
|
||||
}
|
||||
|
||||
void
|
||||
blacklist_notify(int action, int fd, const char *msg)
|
||||
{
|
||||
|
||||
if (blstate == NULL)
|
||||
return;
|
||||
(void)blacklist_r(blstate, action, fd, msg);
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/*-
|
||||
* Copyright (c) 2016 The FreeBSD Foundation
|
||||
*
|
||||
* This software was developed by Kurt Lidl under sponsorship from the
|
||||
* FreeBSD Foundation.
|
||||
*
|
||||
* 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 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 AUTHOR 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. */
|
||||
|
||||
|
||||
#ifndef BLACKLIST_CLIENT_H
|
||||
#define BLACKLIST_CLIENT_H
|
||||
|
||||
#ifndef BLACKLIST_API_ENUM
|
||||
enum {
|
||||
BLACKLIST_AUTH_OK = 0,
|
||||
BLACKLIST_AUTH_FAIL
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef USE_BLACKLIST
|
||||
void blacklist_init(void);
|
||||
void blacklist_notify(int, int, const char *);
|
||||
|
||||
#define BLACKLIST_INIT() blacklist_init()
|
||||
#define BLACKLIST_NOTIFY(x, y, z) blacklist_notify(x, y, z)
|
||||
|
||||
#else
|
||||
|
||||
#define BLACKLIST_INIT()
|
||||
#define BLACKLIST_NOTIFY(x, y, z)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* BLACKLIST_CLIENT_H */
|
||||
|
|
@ -1,280 +0,0 @@
|
|||
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
/* $Id: config.h.in,v 1.15 2001/04/28 07:11:46 lukem Exp $ */
|
||||
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
/* #undef CLOSEDIR_VOID */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* 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 flock function. */
|
||||
#define HAVE_FLOCK 1
|
||||
|
||||
/* Define if you have the fparseln function. */
|
||||
#define HAVE_FPARSELN 1
|
||||
|
||||
/* Define if you have the fts_open function. */
|
||||
#define HAVE_FTS_OPEN 1
|
||||
|
||||
/* Define if you have the getaddrinfo function. */
|
||||
#define HAVE_GETADDRINFO 1
|
||||
|
||||
/* Define if you have the getgrouplist function. */
|
||||
#define HAVE_GETGROUPLIST 1
|
||||
|
||||
/* Define if you have the getnameinfo function. */
|
||||
#define HAVE_GETNAMEINFO 1
|
||||
|
||||
/* Define if you have the getspnam function. */
|
||||
/* #undef HAVE_GETSPNAM */
|
||||
|
||||
/* Define if you have the getusershell function. */
|
||||
#define HAVE_GETUSERSHELL 1
|
||||
|
||||
/* Define if you have the inet_net_pton function. */
|
||||
#define HAVE_INET_NET_PTON 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 lockf function. */
|
||||
#define HAVE_LOCKF 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
#define HAVE_MKSTEMP 1
|
||||
|
||||
/* Define if you have the setlogin function. */
|
||||
#define HAVE_SETLOGIN 1
|
||||
|
||||
/* Define if you have the setproctitle function. */
|
||||
#define HAVE_SETPROCTITLE 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 strmode function. */
|
||||
#define HAVE_STRMODE 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 user_from_uid function. */
|
||||
#define HAVE_USER_FROM_UID 1
|
||||
|
||||
/* Define if you have the usleep function. */
|
||||
#define HAVE_USLEEP 1
|
||||
|
||||
/* Define if you have the vfork function. */
|
||||
#define HAVE_VFORK 1
|
||||
|
||||
/* Define if you have the vsyslog function. */
|
||||
#define HAVE_VSYSLOG 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 <fts.h> header file. */
|
||||
#define HAVE_FTS_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 <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/sysmacros.h> header file. */
|
||||
/* #undef HAVE_SYS_SYSMACROS_H */
|
||||
|
||||
/* Define if you have the <util.h> header file. */
|
||||
/* #undef HAVE_UTIL_H */
|
||||
|
||||
/* Define if you have the crypt library (-lcrypt). */
|
||||
#define HAVE_LIBCRYPT 1
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
/* #undef HAVE_LIBNSL */
|
||||
|
||||
/* Define if you have the skey library (-lskey). */
|
||||
/* #undef HAVE_LIBSKEY */
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* 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 *printf() uses %qd to print `long long' (otherwise uses %lld) */
|
||||
#define HAVE_PRINTF_QD 1
|
||||
|
||||
/* Define if in_port_t exists */
|
||||
#define HAVE_IN_PORT_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 struct passwd.pw_expire exists. */
|
||||
#define HAVE_PW_EXPIRE 1
|
||||
|
||||
/* Define if GLOB_BRACE, gl_path and gl_match exist in <glob.h> */
|
||||
#define HAVE_WORKING_GLOB 1
|
||||
|
||||
/* Define if crypt() is declared in <unistd.h> */
|
||||
#define HAVE_CRYPT_D 1
|
||||
|
||||
/* Define if fclose() is declared in <stdio.h> */
|
||||
#define HAVE_FCLOSE_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 optreset exists */
|
||||
#define HAVE_OPTRESET 1
|
||||
|
||||
/* Define if pclose() is declared in <stdio.h> */
|
||||
#define HAVE_PCLOSE_D 1
|
||||
|
||||
/* Define if getusershell() is declared in <unistd.h> */
|
||||
#define HAVE_GETUSERSHELL_D 1
|
||||
|
||||
/* Define if `long long' is supported and sizeof(off_t) >= 8 */
|
||||
#define HAVE_QUAD_SUPPORT 1
|
||||
|
||||
/* Define if not using in-built /bin/ls code */
|
||||
/* #undef NO_INTERNAL_LS */
|
||||
|
||||
/* Define if using S/Key */
|
||||
/* #undef SKEY */
|
||||
|
||||
/*
|
||||
* 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 */
|
||||
|
||||
/* Define if you have the <arpa/ftp.h> header file. */
|
||||
#define HAVE_FTP_NAMES 1
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1992, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
void blkfree(char **);
|
||||
char **copyblk(char **);
|
||||
void cwd(char *);
|
||||
void delete(char *);
|
||||
void dologout(int);
|
||||
void fatalerror(char *);
|
||||
void ftpd_logwtmp(char *, char *, struct sockaddr *addr);
|
||||
int ftpd_pclose(FILE *);
|
||||
FILE *ftpd_popen(char *, char *);
|
||||
int get_line(char *, int, FILE *);
|
||||
void lreply(int, const char *, ...) __printflike(2, 3);
|
||||
void makedir(char *);
|
||||
void nack(char *);
|
||||
void pass(char *);
|
||||
void passive(void);
|
||||
void long_passive(char *, int);
|
||||
void perror_reply(int, char *);
|
||||
void pwd(void);
|
||||
void removedir(char *);
|
||||
void renamecmd(char *, char *);
|
||||
char *renamefrom(char *);
|
||||
void reply(int, const char *, ...) __printflike(2, 3);
|
||||
void retrieve(char *, char *);
|
||||
void send_file_list(char *);
|
||||
void statcmd(void);
|
||||
void statfilecmd(char *);
|
||||
void store(char *, char *, int);
|
||||
void upper(char *);
|
||||
void user(char *);
|
||||
void yyerror(char *);
|
||||
int yyparse(void);
|
||||
int ls_main(int, char **);
|
||||
|
||||
extern int assumeutf8;
|
||||
extern char cbuf[];
|
||||
extern union sockunion data_dest;
|
||||
extern int epsvall;
|
||||
extern int form;
|
||||
extern int ftpdebug;
|
||||
extern int guest;
|
||||
extern union sockunion his_addr;
|
||||
extern char *homedir;
|
||||
extern int hostinfo;
|
||||
extern char *hostname;
|
||||
extern int maxtimeout;
|
||||
extern int logged_in;
|
||||
extern int logging;
|
||||
extern int noepsv;
|
||||
extern int noguestretr;
|
||||
extern int noretr;
|
||||
extern int paranoid;
|
||||
extern struct passwd *pw;
|
||||
extern int pdata;
|
||||
extern char proctitle[];
|
||||
extern int readonly;
|
||||
extern off_t restart_point;
|
||||
extern int timeout;
|
||||
extern char tmpline[];
|
||||
extern int type;
|
||||
extern char *typenames[]; /* defined in <arpa/ftp.h> included from ftpd.c */
|
||||
extern int usedefault;
|
||||
|
||||
struct sockaddr_in;
|
||||
struct sockaddr_in6;
|
||||
union sockunion {
|
||||
struct sockinet {
|
||||
u_char si_len;
|
||||
u_char si_family;
|
||||
u_short si_port;
|
||||
} su_si;
|
||||
struct sockaddr_in su_sin;
|
||||
struct sockaddr_in6 su_sin6;
|
||||
};
|
||||
#define su_len su_si.si_len
|
||||
#define su_family su_si.si_family
|
||||
#define su_port su_si.si_port
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
.\" Copyright (c) 2003 FreeBSD Project
|
||||
.\" 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 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 AUTHOR 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.
|
||||
.\"
|
||||
.Dd January 26, 2003
|
||||
.Dt FTPCHROOT 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ftpchroot
|
||||
.Nd "list users and groups subject to FTP access restrictions"
|
||||
.Sh DESCRIPTION
|
||||
The file
|
||||
.Nm
|
||||
is read by
|
||||
.Xr ftpd 8
|
||||
at the beginning of an FTP session, after having authenticated the user.
|
||||
Each line in
|
||||
.Nm
|
||||
corresponds to a user or group.
|
||||
If a line in
|
||||
.Nm
|
||||
matches the current user or a group he is a member of,
|
||||
access restrictions will be applied to this
|
||||
session by changing its root directory with
|
||||
.Xr chroot 2
|
||||
to that specified on the line or to the user's login directory.
|
||||
.Pp
|
||||
The order of records in
|
||||
.Nm
|
||||
is important because the first match will be used.
|
||||
Fields on each line are separated by tabs or spaces.
|
||||
.Pp
|
||||
The first field specifies a user or group name.
|
||||
If it is prefixed by an
|
||||
.Dq at
|
||||
sign,
|
||||
.Ql @ ,
|
||||
it specifies a group name;
|
||||
the line will match each user who is a member of this group.
|
||||
As a special case, a single
|
||||
.Ql @
|
||||
in this field will match any user.
|
||||
A username is specified otherwise.
|
||||
.Pp
|
||||
The optional second field describes the directory for the user
|
||||
or each member of the group to be locked up in using
|
||||
.Xr chroot 2 .
|
||||
Be it omitted, the user's login directory will be used.
|
||||
If it is not an absolute pathname, then it will be relative
|
||||
to the user's login directory.
|
||||
If it contains the
|
||||
.Pa /./
|
||||
separator,
|
||||
.Xr ftpd 8
|
||||
will treat its left-hand side as the name of the directory to do
|
||||
.Xr chroot 2
|
||||
to, and its right-hand side to change the current directory to afterwards.
|
||||
.Sh FILES
|
||||
.Bl -tag -width ".Pa /etc/ftpchroot" -compact
|
||||
.It Pa /etc/ftpchroot
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
These lines in
|
||||
.Nm
|
||||
will lock up the user
|
||||
.Dq Li webuser
|
||||
and each member of the group
|
||||
.Dq Li hostee
|
||||
in their respective login directories:
|
||||
.Bd -literal -offset indent
|
||||
webuser
|
||||
@hostee
|
||||
.Ed
|
||||
.Pp
|
||||
And this line will tell
|
||||
.Xr ftpd 8
|
||||
to lock up the user
|
||||
.Dq Li joe
|
||||
in
|
||||
.Pa /var/spool/ftp
|
||||
and then to change the current directory to
|
||||
.Pa /joe ,
|
||||
which is relative to the session's new root:
|
||||
.Pp
|
||||
.Dl "joe /var/spool/ftp/./joe"
|
||||
.Pp
|
||||
And finally the following line will lock up every user connecting
|
||||
through FTP in his respective
|
||||
.Pa ~/public_html ,
|
||||
thus lowering possible impact on the system
|
||||
from intrinsic insecurity of FTP:
|
||||
.Pp
|
||||
.Dl "@ public_html"
|
||||
.Sh SEE ALSO
|
||||
.Xr chroot 2 ,
|
||||
.Xr group 5 ,
|
||||
.Xr passwd 5 ,
|
||||
.Xr ftpd 8
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,589 +0,0 @@
|
|||
.\" Copyright (c) 1985, 1988, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
|
||||
.\"
|
||||
.Dd June 26, 2025
|
||||
.Dt FTPD 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm ftpd
|
||||
.Nd Internet File Transfer Protocol server
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl 468BDdEhMmOoRrSUvW
|
||||
.Bq Fl A | Fl n
|
||||
.Op Fl l Op Fl l
|
||||
.Op Fl a Ar address
|
||||
.Op Fl P Ar port
|
||||
.Op Fl p Ar file
|
||||
.Op Fl T Ar maxtimeout
|
||||
.Op Fl t Ar timeout
|
||||
.Op Fl u Ar umask
|
||||
.Sh DEPRECATION NOTICE
|
||||
The
|
||||
.Fx
|
||||
base system
|
||||
.Nm
|
||||
is deprecated, and will be removed in
|
||||
.Fx 15.0 .
|
||||
Users are advised to install the
|
||||
.Pa ftp/freebsd-ftpd
|
||||
port or package instead.
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
utility is the
|
||||
Internet File Transfer Protocol
|
||||
server process.
|
||||
The server uses the TCP protocol
|
||||
and listens at the port specified with the
|
||||
.Fl P
|
||||
option or in the
|
||||
.Dq ftp
|
||||
service specification; see
|
||||
.Xr services 5 .
|
||||
.Pp
|
||||
Available options:
|
||||
.Bl -tag -width indent
|
||||
.It Fl 4
|
||||
When
|
||||
.Fl D
|
||||
is specified, accept connections via
|
||||
.Dv AF_INET
|
||||
socket.
|
||||
.It Fl 6
|
||||
When
|
||||
.Fl D
|
||||
is specified, accept connections via
|
||||
.Dv AF_INET6
|
||||
socket.
|
||||
.It Fl 8
|
||||
Enable transparent UTF-8 mode.
|
||||
RFC\ 2640 compliant clients will be told that the character encoding
|
||||
used by the server is UTF-8, which is the only effect of the option.
|
||||
.Pp
|
||||
This option does not enable any encoding conversion for server file names;
|
||||
it implies instead that the names of files on the server are encoded
|
||||
in UTF-8.
|
||||
As for files uploaded via FTP, it is the duty of the RFC\ 2640 compliant
|
||||
client to convert their names from the client's local encoding to UTF-8.
|
||||
FTP command names and own
|
||||
.Nm
|
||||
messages are always encoded in ASCII, which is a subset of UTF-8.
|
||||
Hence no need for server-side conversion at all.
|
||||
.It Fl A
|
||||
Allow only anonymous ftp access.
|
||||
.It Fl a
|
||||
When
|
||||
.Fl D
|
||||
is specified, accept connections only on the specified
|
||||
.Ar address .
|
||||
.It Fl B
|
||||
With this option set,
|
||||
.Nm
|
||||
sends authentication success and failure messages to the
|
||||
.Xr blacklistd 8
|
||||
daemon.
|
||||
If this option is not specified, no communcation with the
|
||||
.Xr blacklistd 8
|
||||
daemon is attempted.
|
||||
.It Fl D
|
||||
With this option set,
|
||||
.Nm
|
||||
will detach and become a daemon, accepting connections on the FTP port and
|
||||
forking children processes to handle them.
|
||||
This is lower overhead than starting
|
||||
.Nm
|
||||
from
|
||||
.Xr inetd 8
|
||||
and is thus useful on busy servers to reduce load.
|
||||
.It Fl d
|
||||
Debugging information is written to the syslog using
|
||||
.Dv LOG_FTP .
|
||||
.It Fl E
|
||||
Disable the EPSV command.
|
||||
This is useful for servers behind older firewalls.
|
||||
.It Fl h
|
||||
Disable printing host-specific information, such as the
|
||||
server software version or hostname, in server messages.
|
||||
.It Fl l
|
||||
Each successful and failed
|
||||
.Xr ftp 1
|
||||
session is logged using syslog with a facility of
|
||||
.Dv LOG_FTP .
|
||||
If this option is specified twice, the retrieve (get), store (put), append,
|
||||
delete, make directory, remove directory and rename operations and
|
||||
their filename arguments are also logged.
|
||||
By default,
|
||||
.Xr syslogd 8
|
||||
logs these to
|
||||
.Pa /var/log/xferlog .
|
||||
.It Fl M
|
||||
Prevent anonymous users from creating directories.
|
||||
.It Fl m
|
||||
Permit anonymous users to overwrite or modify
|
||||
existing files if allowed by file system permissions.
|
||||
By default, anonymous users cannot modify existing files;
|
||||
in particular, files to upload will be created under a unique name.
|
||||
.It Fl n
|
||||
Disable anonymous FTP access.
|
||||
The
|
||||
.Fl n
|
||||
option is mutually exclusive with the
|
||||
.Fl A
|
||||
option.
|
||||
.It Fl O
|
||||
Put server in write-only mode for anonymous users only.
|
||||
RETR is disabled for anonymous users, preventing anonymous downloads.
|
||||
This has no effect if
|
||||
.Fl o
|
||||
is also specified.
|
||||
.It Fl o
|
||||
Put server in write-only mode.
|
||||
RETR is disabled, preventing downloads.
|
||||
.It Fl P
|
||||
When
|
||||
.Fl D
|
||||
is specified, accept connections at
|
||||
.Ar port ,
|
||||
specified as a numeric value or service name, instead of at the default
|
||||
.Dq ftp
|
||||
port.
|
||||
.It Fl p
|
||||
When
|
||||
.Fl D
|
||||
is specified, write the daemon's process ID to
|
||||
.Ar file
|
||||
instead of the default pid file,
|
||||
.Pa /var/run/ftpd.pid .
|
||||
.It Fl R
|
||||
With this option set,
|
||||
.Nm
|
||||
will revert to historical behavior with regard to security checks on
|
||||
user operations and restrictions on PORT requests.
|
||||
Currently,
|
||||
.Nm
|
||||
will only honor PORT commands directed to unprivileged ports on the
|
||||
remote user's host (which violates the FTP protocol specification but
|
||||
closes some security holes).
|
||||
.It Fl r
|
||||
Put server in read-only mode.
|
||||
All commands which may modify the local file system are disabled.
|
||||
.It Fl S
|
||||
With this option set,
|
||||
.Nm
|
||||
logs all anonymous file downloads to the file
|
||||
.Pa /var/log/ftpd
|
||||
when this file exists.
|
||||
.It Fl T
|
||||
A client may also request a different timeout period;
|
||||
the maximum period allowed may be set to
|
||||
.Ar timeout
|
||||
seconds with the
|
||||
.Fl T
|
||||
option.
|
||||
The default limit is 2 hours.
|
||||
.It Fl t
|
||||
The inactivity timeout period is set to
|
||||
.Ar timeout
|
||||
seconds (the default is 15 minutes).
|
||||
.It Fl U
|
||||
This option instructs ftpd to use data ports in the range of
|
||||
.Dv IP_PORTRANGE_DEFAULT
|
||||
instead of in the range of
|
||||
.Dv IP_PORTRANGE_HIGH .
|
||||
Such a change may be useful for some specific firewall configurations;
|
||||
see
|
||||
.Xr ip 4
|
||||
for more information.
|
||||
.Pp
|
||||
Note that option is a virtual no-op in
|
||||
.Fx 5.0
|
||||
and above; both port
|
||||
ranges are identical by default.
|
||||
.It Fl u
|
||||
The default file creation mode mask is set to
|
||||
.Ar umask ,
|
||||
which is expected to be an octal numeric value.
|
||||
Refer to
|
||||
.Xr umask 2
|
||||
for details.
|
||||
This option may be overridden by
|
||||
.Xr login.conf 5 .
|
||||
.It Fl v
|
||||
A synonym for
|
||||
.Fl d .
|
||||
.It Fl W
|
||||
Do not log FTP sessions to the user accounting database.
|
||||
.El
|
||||
.Pp
|
||||
The file
|
||||
.Pa /var/run/nologin
|
||||
can be used to disable ftp access.
|
||||
If the file exists,
|
||||
.Nm
|
||||
displays it and exits.
|
||||
If the file
|
||||
.Pa /etc/ftpwelcome
|
||||
exists,
|
||||
.Nm
|
||||
prints it before issuing the
|
||||
.Dq ready
|
||||
message.
|
||||
If the file
|
||||
.Pa /etc/ftpmotd
|
||||
exists,
|
||||
.Nm
|
||||
prints it after a successful login.
|
||||
Note the motd file used is the one
|
||||
relative to the login environment.
|
||||
This means the one in
|
||||
.Pa ~ftp/etc
|
||||
in the anonymous user's case.
|
||||
.Pp
|
||||
The ftp server currently supports the following ftp requests.
|
||||
The case of the requests is ignored.
|
||||
Requests marked [RW] are
|
||||
disabled if
|
||||
.Fl r
|
||||
is specified.
|
||||
.Bl -column "Request" -offset indent
|
||||
.It Sy Request Ta Sy "Description"
|
||||
.It ABOR Ta "abort previous command"
|
||||
.It ACCT Ta "specify account (ignored)"
|
||||
.It ALLO Ta "allocate storage (vacuously)"
|
||||
.It APPE Ta "append to a file [RW]"
|
||||
.It CDUP Ta "change to parent of current working directory"
|
||||
.It CWD Ta "change working directory"
|
||||
.It DELE Ta "delete a file [RW]"
|
||||
.It EPRT Ta "specify data connection port, multiprotocol"
|
||||
.It EPSV Ta "prepare for server-to-server transfer, multiprotocol"
|
||||
.It FEAT Ta "give information on extended features of server"
|
||||
.It HELP Ta "give help information"
|
||||
.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lA"
|
||||
.It LPRT Ta "specify data connection port, multiprotocol"
|
||||
.It LPSV Ta "prepare for server-to-server transfer, multiprotocol"
|
||||
.It MDTM Ta "show last modification time of file"
|
||||
.It MKD Ta "make a directory [RW]"
|
||||
.It MODE Ta "specify data transfer" Em mode
|
||||
.It NLST Ta "give name list of files in directory"
|
||||
.It NOOP Ta "do nothing"
|
||||
.It PASS Ta "specify password"
|
||||
.It PASV Ta "prepare for server-to-server transfer"
|
||||
.It PORT Ta "specify data connection port"
|
||||
.It PWD Ta "print the current working directory"
|
||||
.It QUIT Ta "terminate session"
|
||||
.It REST Ta "restart incomplete transfer"
|
||||
.It RETR Ta "retrieve a file"
|
||||
.It RMD Ta "remove a directory [RW]"
|
||||
.It RNFR Ta "specify rename-from file name [RW]"
|
||||
.It RNTO Ta "specify rename-to file name [RW]"
|
||||
.It SITE Ta "non-standard commands (see next section)"
|
||||
.It SIZE Ta "return size of file"
|
||||
.It STAT Ta "return status of server"
|
||||
.It STOR Ta "store a file [RW]"
|
||||
.It STOU Ta "store a file with a unique name [RW]"
|
||||
.It STRU Ta "specify data transfer" Em structure
|
||||
.It SYST Ta "show operating system type of server system"
|
||||
.It TYPE Ta "specify data transfer" Em type
|
||||
.It USER Ta "specify user name"
|
||||
.It XCUP Ta "change to parent of current working directory (deprecated)"
|
||||
.It XCWD Ta "change working directory (deprecated)"
|
||||
.It XMKD Ta "make a directory (deprecated) [RW]"
|
||||
.It XPWD Ta "print the current working directory (deprecated)"
|
||||
.It XRMD Ta "remove a directory (deprecated) [RW]"
|
||||
.El
|
||||
.Pp
|
||||
The following non-standard or
|
||||
.Ux
|
||||
specific commands are supported
|
||||
by the
|
||||
SITE request.
|
||||
.Bl -column Request -offset indent
|
||||
.It Sy Request Ta Sy Description
|
||||
.It UMASK Ta change umask, e.g. ``SITE UMASK 002''
|
||||
.It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60''
|
||||
.It CHMOD Ta "change mode of a file [RW], e.g. ``SITE CHMOD 755 filename''"
|
||||
.It MD5 Ta "report the files MD5 checksum, e.g. ``SITE MD5 filename''"
|
||||
.It HELP Ta give help information
|
||||
.El
|
||||
.Pp
|
||||
Note: SITE requests are disabled in case of anonymous logins.
|
||||
.Pp
|
||||
The remaining ftp requests specified in Internet RFC 959
|
||||
are
|
||||
recognized, but not implemented.
|
||||
MDTM and SIZE are not specified in RFC 959, but will appear in the
|
||||
next updated FTP RFC.
|
||||
To avoid possible denial-of-service attacks, SIZE requests against
|
||||
files larger than 10240 bytes will be denied if the current transfer
|
||||
type is ASCII.
|
||||
.Pp
|
||||
The ftp server will abort an active file transfer only when the
|
||||
ABOR
|
||||
command is preceded by a Telnet "Interrupt Process" (IP)
|
||||
signal and a Telnet "Synch" signal in the command Telnet stream,
|
||||
as described in Internet RFC 959.
|
||||
If a
|
||||
STAT
|
||||
command is received during a data transfer, preceded by a Telnet IP
|
||||
and Synch, transfer status will be returned.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
utility interprets file names according to the
|
||||
.Dq globbing
|
||||
conventions used by
|
||||
.Xr csh 1 .
|
||||
This allows users to utilize the metacharacters
|
||||
.Dq Li \&*?[]{}~ .
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
utility authenticates users according to six rules.
|
||||
.Bl -enum -offset indent
|
||||
.It
|
||||
The login name must be in the password data base
|
||||
and not have a null password.
|
||||
In this case a password must be provided by the client before any
|
||||
file operations may be performed.
|
||||
.It
|
||||
The login name must not appear in the file
|
||||
.Pa /etc/ftpusers .
|
||||
.It
|
||||
The login name must not be a member of a group specified in the file
|
||||
.Pa /etc/ftpusers .
|
||||
Entries in this file interpreted as group names are prefixed by an "at"
|
||||
.Ql \&@
|
||||
sign.
|
||||
.It
|
||||
The user must have a standard shell returned by
|
||||
.Xr getusershell 3 .
|
||||
.It
|
||||
If the user name appears in the file
|
||||
.Pa /etc/ftpchroot ,
|
||||
or the user is a member of a group with a group entry in this file,
|
||||
i.e., one prefixed with
|
||||
.Ql \&@ ,
|
||||
the session's root will be changed to the directory specified
|
||||
in this file or to the user's login directory by
|
||||
.Xr chroot 2
|
||||
as for an
|
||||
.Dq anonymous
|
||||
or
|
||||
.Dq ftp
|
||||
account (see next item).
|
||||
See
|
||||
.Xr ftpchroot 5
|
||||
for a detailed description of the format of this file.
|
||||
This facility may also be triggered by enabling the boolean "ftp-chroot"
|
||||
capability in
|
||||
.Xr login.conf 5 .
|
||||
However, the user must still supply a password.
|
||||
This feature is intended as a compromise between a fully anonymous
|
||||
account and a fully privileged account.
|
||||
The account should also be set up as for an anonymous account.
|
||||
.It
|
||||
If the user name is
|
||||
.Dq anonymous
|
||||
or
|
||||
.Dq ftp ,
|
||||
an
|
||||
anonymous ftp account must be present in the password
|
||||
file (user
|
||||
.Dq ftp ) .
|
||||
In this case the user is allowed
|
||||
to log in by specifying any password (by convention an email address for
|
||||
the user should be used as the password).
|
||||
When the
|
||||
.Fl S
|
||||
option is set, all transfers are logged as well.
|
||||
.El
|
||||
.Pp
|
||||
In the last case,
|
||||
.Nm
|
||||
takes special measures to restrict the client's access privileges.
|
||||
The server performs a
|
||||
.Xr chroot 2
|
||||
to the home directory of the
|
||||
.Dq ftp
|
||||
user.
|
||||
As a special case if the
|
||||
.Dq ftp
|
||||
user's home directory pathname contains the
|
||||
.Pa /./
|
||||
separator,
|
||||
.Nm
|
||||
uses its left-hand side as the name of the directory to do
|
||||
.Xr chroot 2
|
||||
to, and its right-hand side to change the current directory to afterwards.
|
||||
A typical example for this case would be
|
||||
.Pa /var/spool/ftp/./pub .
|
||||
In order that system security is not breached, it is recommended
|
||||
that the
|
||||
.Dq ftp
|
||||
subtree be constructed with care, following these rules:
|
||||
.Bl -tag -width "~ftp/pub" -offset indent
|
||||
.It Pa ~ftp
|
||||
Make the home directory owned by
|
||||
.Dq root
|
||||
and unwritable by anyone.
|
||||
.It Pa ~ftp/etc
|
||||
Make this directory owned by
|
||||
.Dq root
|
||||
and unwritable by anyone (mode 555).
|
||||
The files pwd.db (see
|
||||
.Xr passwd 5 )
|
||||
and
|
||||
.Xr group 5
|
||||
must be present for the
|
||||
.Xr ls 1
|
||||
command to be able to produce owner names rather than numbers.
|
||||
The password field in
|
||||
.Xr passwd 5
|
||||
is not used, and should not contain real passwords.
|
||||
The file
|
||||
.Pa ftpmotd ,
|
||||
if present, will be printed after a successful login.
|
||||
These files should be mode 444.
|
||||
.It Pa ~ftp/pub
|
||||
This directory and the subdirectories beneath it should be owned
|
||||
by the users and groups responsible for placing files in them,
|
||||
and be writable only by them (mode 755 or 775).
|
||||
They should
|
||||
.Em not
|
||||
be owned or writable by
|
||||
.Dq ftp
|
||||
or its group, otherwise guest users
|
||||
can fill the drive with unwanted files.
|
||||
.El
|
||||
.Pp
|
||||
If the system has multiple IP addresses,
|
||||
.Nm
|
||||
supports the idea of virtual hosts, which provides the ability to
|
||||
define multiple anonymous ftp areas, each one allocated to a different
|
||||
internet address.
|
||||
The file
|
||||
.Pa /etc/ftphosts
|
||||
contains information pertaining to each of the virtual hosts.
|
||||
Each host is defined on its own line which contains a number of
|
||||
fields separated by whitespace:
|
||||
.Bl -tag -offset indent -width hostname
|
||||
.It hostname
|
||||
Contains the hostname or IP address of the virtual host.
|
||||
.It user
|
||||
Contains a user record in the system password file.
|
||||
As with normal anonymous ftp, this user's access uid, gid and group
|
||||
memberships determine file access to the anonymous ftp area.
|
||||
The anonymous ftp area (to which any user is chrooted on login)
|
||||
is determined by the home directory defined for the account.
|
||||
User id and group for any ftp account may be the same as for the
|
||||
standard ftp user.
|
||||
.It statfile
|
||||
File to which all file transfers are logged, which
|
||||
defaults to
|
||||
.Pa /var/log/ftpd .
|
||||
.It welcome
|
||||
This file is the welcome message displayed before the server ready
|
||||
prompt.
|
||||
It defaults to
|
||||
.Pa /etc/ftpwelcome .
|
||||
.It motd
|
||||
This file is displayed after the user logs in.
|
||||
It defaults to
|
||||
.Pa /etc/ftpmotd .
|
||||
.El
|
||||
.Pp
|
||||
Lines beginning with a '#' are ignored and can be used to include
|
||||
comments.
|
||||
.Pp
|
||||
Defining a virtual host for the primary IP address or hostname
|
||||
changes the default for ftp logins to that address.
|
||||
The 'user', 'statfile', 'welcome' and 'motd' fields may be left
|
||||
blank, or a single hyphen '-' used to indicate that the default
|
||||
value is to be used.
|
||||
.Pp
|
||||
As with any anonymous login configuration, due care must be given
|
||||
to setup and maintenance to guard against security related problems.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
utility has internal support for handling remote requests to list
|
||||
files, and will not execute
|
||||
.Pa /bin/ls
|
||||
in either a chrooted or non-chrooted environment.
|
||||
The
|
||||
.Pa ~/bin/ls
|
||||
executable need not be placed into the chrooted tree, nor need the
|
||||
.Pa ~/bin
|
||||
directory exist.
|
||||
.Sh FILES
|
||||
.Bl -tag -width ".Pa /var/run/ftpd.pid" -compact
|
||||
.It Pa /etc/ftpusers
|
||||
List of unwelcome/restricted users.
|
||||
.It Pa /etc/ftpchroot
|
||||
List of normal users who should be chroot'd.
|
||||
.It Pa /etc/ftphosts
|
||||
Virtual hosting configuration file.
|
||||
.It Pa /etc/ftpwelcome
|
||||
Welcome notice.
|
||||
.It Pa /etc/ftpmotd
|
||||
Welcome notice after login.
|
||||
.It Pa /var/run/ftpd.pid
|
||||
Default pid file for daemon mode.
|
||||
.It Pa /var/run/nologin
|
||||
Displayed and access refused.
|
||||
.It Pa /var/log/ftpd
|
||||
Log file for anonymous transfers.
|
||||
.It Pa /var/log/xferlog
|
||||
Default place for session logs.
|
||||
.It Pa /var/spool/ftp
|
||||
Recommended directory for the FTP root directory
|
||||
(the home directory of the ftp user).
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr ftp 1 ,
|
||||
.Xr umask 2 ,
|
||||
.Xr getusershell 3 ,
|
||||
.Xr ftpchroot 5 ,
|
||||
.Xr login.conf 5 ,
|
||||
.Xr inetd 8 ,
|
||||
.Xr syslogd 8
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
utility appeared in
|
||||
.Bx 4.2 .
|
||||
IPv6 support was added in WIDE Hydrangea IPv6 stack kit.
|
||||
.Sh BUGS
|
||||
The server must run as the super-user
|
||||
to create sockets with privileged port numbers.
|
||||
It maintains
|
||||
an effective user id of the logged in user, reverting to
|
||||
the super-user only when binding addresses to sockets.
|
||||
The
|
||||
possible security holes have been extensively
|
||||
scrutinized, but are possibly incomplete.
|
||||
3448
libexec/ftpd/ftpd.c
3448
libexec/ftpd/ftpd.c
File diff suppressed because it is too large
Load diff
|
|
@ -1,28 +0,0 @@
|
|||
#
|
||||
# list of users disallowed any ftp access.
|
||||
# read by ftpd(8).
|
||||
root
|
||||
toor
|
||||
daemon
|
||||
operator
|
||||
bin
|
||||
tty
|
||||
kmem
|
||||
games
|
||||
news
|
||||
ntpd
|
||||
man
|
||||
sshd
|
||||
smmsp
|
||||
mailnull
|
||||
bind
|
||||
unbound
|
||||
proxy
|
||||
_pflogd
|
||||
_dhcp
|
||||
uucp
|
||||
pop
|
||||
auditdistd
|
||||
www
|
||||
hast
|
||||
nobody
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <libutil.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <utmpx.h>
|
||||
#include "extern.h"
|
||||
|
||||
void
|
||||
ftpd_logwtmp(char *id, char *user, struct sockaddr *addr)
|
||||
{
|
||||
struct utmpx ut;
|
||||
|
||||
memset(&ut, 0, sizeof(ut));
|
||||
|
||||
if (user != NULL) {
|
||||
/* Log in. */
|
||||
ut.ut_type = USER_PROCESS;
|
||||
(void)strncpy(ut.ut_user, user, sizeof(ut.ut_user));
|
||||
if (addr != NULL)
|
||||
realhostname_sa(ut.ut_host, sizeof(ut.ut_host),
|
||||
addr, addr->sa_len);
|
||||
} else {
|
||||
/* Log out. */
|
||||
ut.ut_type = DEAD_PROCESS;
|
||||
}
|
||||
|
||||
ut.ut_pid = getpid();
|
||||
gettimeofday(&ut.ut_tv, NULL);
|
||||
(void)strncpy(ut.ut_id, id, sizeof(ut.ut_id));
|
||||
(void)strncpy(ut.ut_line, "ftpd", sizeof(ut.ut_line));
|
||||
|
||||
pututxline(&ut);
|
||||
}
|
||||
|
|
@ -1,39 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1989, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <paths.h>
|
||||
|
||||
#define _PATH_FTPCHROOT "/etc/ftpchroot"
|
||||
#define _PATH_FTPWELCOME "/etc/ftpwelcome"
|
||||
#define _PATH_FTPLOGINMESG "/etc/ftpmotd"
|
||||
#define _PATH_FTPHOSTS "/etc/ftphosts"
|
||||
#define _PATH_FTPDSTATFILE "/var/log/ftpd"
|
||||
#define _PATH_LS "/bin/ls"
|
||||
|
|
@ -1,193 +0,0 @@
|
|||
/*-
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*
|
||||
* Copyright (c) 1988, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software written by Ken Arnold and
|
||||
* published in UNIX Review, Vol. 6, No. 8.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <glob.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "extern.h"
|
||||
#include "pathnames.h"
|
||||
#include <syslog.h>
|
||||
#include <time.h>
|
||||
|
||||
#define MAXUSRARGS 100
|
||||
#define MAXGLOBARGS 1000
|
||||
|
||||
/*
|
||||
* Special version of popen which avoids call to shell. This ensures no one
|
||||
* may create a pipe to a hidden program as a side effect of a list or dir
|
||||
* command.
|
||||
*/
|
||||
static int *pids;
|
||||
static int fds;
|
||||
|
||||
FILE *
|
||||
ftpd_popen(char *program, char *type)
|
||||
{
|
||||
char *cp;
|
||||
FILE *iop;
|
||||
int argc, gargc, pdes[2], pid;
|
||||
char **pop, *argv[MAXUSRARGS], *gargv[MAXGLOBARGS];
|
||||
|
||||
if (((*type != 'r') && (*type != 'w')) || type[1])
|
||||
return (NULL);
|
||||
|
||||
if (!pids) {
|
||||
if ((fds = getdtablesize()) <= 0)
|
||||
return (NULL);
|
||||
if ((pids = calloc(fds, sizeof(int))) == NULL)
|
||||
return (NULL);
|
||||
}
|
||||
if (pipe(pdes) < 0)
|
||||
return (NULL);
|
||||
|
||||
/* break up string into pieces */
|
||||
for (argc = 0, cp = program; argc < MAXUSRARGS; cp = NULL) {
|
||||
if (!(argv[argc++] = strtok(cp, " \t\n")))
|
||||
break;
|
||||
}
|
||||
argv[argc - 1] = NULL;
|
||||
|
||||
/* glob each piece */
|
||||
gargv[0] = argv[0];
|
||||
for (gargc = argc = 1; argv[argc] && gargc < (MAXGLOBARGS-1); argc++) {
|
||||
glob_t gl;
|
||||
int flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE;
|
||||
|
||||
memset(&gl, 0, sizeof(gl));
|
||||
gl.gl_matchc = MAXGLOBARGS;
|
||||
flags |= GLOB_LIMIT;
|
||||
if (glob(argv[argc], flags, NULL, &gl))
|
||||
gargv[gargc++] = strdup(argv[argc]);
|
||||
else if (gl.gl_pathc > 0) {
|
||||
for (pop = gl.gl_pathv; *pop && gargc < (MAXGLOBARGS-1);
|
||||
pop++)
|
||||
gargv[gargc++] = strdup(*pop);
|
||||
}
|
||||
globfree(&gl);
|
||||
}
|
||||
gargv[gargc] = NULL;
|
||||
|
||||
iop = NULL;
|
||||
fflush(NULL);
|
||||
pid = (strcmp(gargv[0], _PATH_LS) == 0) ? fork() : vfork();
|
||||
switch(pid) {
|
||||
case -1: /* error */
|
||||
(void)close(pdes[0]);
|
||||
(void)close(pdes[1]);
|
||||
goto pfree;
|
||||
/* NOTREACHED */
|
||||
case 0: /* child */
|
||||
if (*type == 'r') {
|
||||
if (pdes[1] != STDOUT_FILENO) {
|
||||
dup2(pdes[1], STDOUT_FILENO);
|
||||
(void)close(pdes[1]);
|
||||
}
|
||||
dup2(STDOUT_FILENO, STDERR_FILENO); /* stderr too! */
|
||||
(void)close(pdes[0]);
|
||||
} else {
|
||||
if (pdes[0] != STDIN_FILENO) {
|
||||
dup2(pdes[0], STDIN_FILENO);
|
||||
(void)close(pdes[0]);
|
||||
}
|
||||
(void)close(pdes[1]);
|
||||
}
|
||||
/* Drop privileges before proceeding */
|
||||
if (getuid() != geteuid() && setuid(geteuid()) < 0)
|
||||
_exit(1);
|
||||
if (strcmp(gargv[0], _PATH_LS) == 0) {
|
||||
/* Reset getopt for ls_main() */
|
||||
optreset = optind = optopt = 1;
|
||||
/* Close syslogging to remove pwd.db missing msgs */
|
||||
closelog();
|
||||
/* Trigger to sense new /etc/localtime after chroot */
|
||||
if (getenv("TZ") == NULL) {
|
||||
setenv("TZ", "", 0);
|
||||
tzset();
|
||||
unsetenv("TZ");
|
||||
tzset();
|
||||
}
|
||||
exit(ls_main(gargc, gargv));
|
||||
}
|
||||
execv(gargv[0], gargv);
|
||||
_exit(1);
|
||||
}
|
||||
/* parent; assume fdopen can't fail... */
|
||||
if (*type == 'r') {
|
||||
iop = fdopen(pdes[0], type);
|
||||
(void)close(pdes[1]);
|
||||
} else {
|
||||
iop = fdopen(pdes[1], type);
|
||||
(void)close(pdes[0]);
|
||||
}
|
||||
pids[fileno(iop)] = pid;
|
||||
|
||||
pfree: for (argc = 1; gargv[argc] != NULL; argc++)
|
||||
free(gargv[argc]);
|
||||
|
||||
return (iop);
|
||||
}
|
||||
|
||||
int
|
||||
ftpd_pclose(FILE *iop)
|
||||
{
|
||||
int fdes, omask, status;
|
||||
pid_t pid;
|
||||
|
||||
/*
|
||||
* pclose returns -1 if stream is not associated with a
|
||||
* `popened' command, or, if already `pclosed'.
|
||||
*/
|
||||
if (pids == NULL || pids[fdes = fileno(iop)] == 0)
|
||||
return (-1);
|
||||
(void)fclose(iop);
|
||||
omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
|
||||
while ((pid = waitpid(pids[fdes], &status, 0)) < 0 && errno == EINTR)
|
||||
continue;
|
||||
(void)sigsetmask(omask);
|
||||
pids[fdes] = 0;
|
||||
if (pid < 0)
|
||||
return (pid);
|
||||
if (WIFEXITED(status))
|
||||
return (WEXITSTATUS(status));
|
||||
return (1);
|
||||
}
|
||||
|
|
@ -369,9 +369,6 @@ sshd_enable="NO" # Enable sshd
|
|||
sshd_oomprotect="YES" # Don't kill sshd when swap space is exhausted.
|
||||
sshd_program="/usr/sbin/sshd" # path to sshd, if you want a different one.
|
||||
sshd_flags="" # Additional flags for sshd.
|
||||
ftpd_enable="NO" # Enable stand-alone ftpd.
|
||||
ftpd_program="/usr/libexec/ftpd" # Path to ftpd, if you want a different one.
|
||||
ftpd_flags="" # Additional flags to stand-alone ftpd.
|
||||
|
||||
### Network daemon (NFS): All need rpcbind_enable="YES" ###
|
||||
autofs_enable="NO" # Run autofs daemons.
|
||||
|
|
|
|||
|
|
@ -216,12 +216,6 @@ CCD= ccd
|
|||
CCDPACKAGE= ccdconfig
|
||||
.endif
|
||||
|
||||
.if ${MK_FTP} != "no"
|
||||
CONFGROUPS+= FTPD
|
||||
FTPD= ftpd
|
||||
FTPDPACKAGE= ftpd
|
||||
.endif
|
||||
|
||||
.if ${MK_KERBEROS_SUPPORT} != "no"
|
||||
CONFGROUPS+= GSSD
|
||||
GSSD= gssd
|
||||
|
|
|
|||
|
|
@ -1,22 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
#
|
||||
|
||||
# PROVIDE: ftpd
|
||||
# REQUIRE: LOGIN FILESYSTEMS
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
|
||||
name="ftpd"
|
||||
desc="Internet File Transfer Protocol daemon"
|
||||
rcvar="ftpd_enable"
|
||||
command="/usr/libexec/${name}"
|
||||
command_args="-D"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
|
||||
: ${ftpd_svcj_options:="net_basic"}
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
run_rc_command "$1"
|
||||
|
|
@ -24,7 +24,6 @@ oci_image_build() {
|
|||
FreeBSD-fd \
|
||||
FreeBSD-fetch \
|
||||
FreeBSD-ftp \
|
||||
FreeBSD-ftpd \
|
||||
FreeBSD-inetd \
|
||||
FreeBSD-ipf \
|
||||
FreeBSD-ipfw \
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ devfs.conf - configuration file for devfs(8)
|
|||
dhclient.conf - configuration file for dhclient(8)
|
||||
disktab - disk description file (see disktab(5))
|
||||
fbtab - configuration file for login(1)
|
||||
ftpusers - user restriction file for ftpd(8)
|
||||
gettytab - defines port configuration for getty(8)
|
||||
group - group permissions file (see group(5))
|
||||
hosts - see hosts(5)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd July 15, 2025
|
||||
.Dd September 25, 2025
|
||||
.Dt RC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -3867,27 +3867,6 @@ is set to
|
|||
these are the flags to pass to the
|
||||
.Xr sshd 8
|
||||
daemon.
|
||||
.It Va ftpd_program
|
||||
.Pq Vt str
|
||||
Path to the FTP server program
|
||||
.Pa ( /usr/libexec/ftpd
|
||||
is the default).
|
||||
.It Va ftpd_enable
|
||||
.Pq Vt bool
|
||||
Set to
|
||||
.Dq Li YES
|
||||
to start
|
||||
.Xr ftpd 8
|
||||
as a stand-alone daemon at system boot time.
|
||||
.It Va ftpd_flags
|
||||
.Pq Vt str
|
||||
If
|
||||
.Va ftpd_enable
|
||||
is set to
|
||||
.Dq Li YES ,
|
||||
these are the additional flags to pass to the
|
||||
.Xr ftpd 8
|
||||
daemon.
|
||||
.It Va watchdogd_enable
|
||||
.Pq Vt bool
|
||||
If set to
|
||||
|
|
@ -5116,7 +5095,6 @@ to
|
|||
.Xr cron 8 ,
|
||||
.Xr devfs 8 ,
|
||||
.Xr dhclient 8 ,
|
||||
.Xr ftpd 8 ,
|
||||
.Xr geli 8 ,
|
||||
.Xr hcsecd 8 ,
|
||||
.Xr ifconfig 8 ,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
.\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
|
||||
.Dd September 10, 2025
|
||||
.Dd September 25, 2025
|
||||
.Dt SRC.CONF 5
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -242,8 +242,7 @@ is set explicitly)
|
|||
Build some programs without
|
||||
.Xr libblacklist 3
|
||||
support, like
|
||||
.Xr fingerd 8 ,
|
||||
.Xr ftpd 8 ,
|
||||
.Xr fingerd 8
|
||||
and
|
||||
.Xr sshd 8 .
|
||||
.It Va WITHOUT_BLUETOOTH
|
||||
|
|
@ -720,9 +719,7 @@ Do not build
|
|||
.Xr freebsd-update 8 .
|
||||
.It Va WITHOUT_FTP
|
||||
Do not build or install
|
||||
.Xr ftp 1
|
||||
and
|
||||
.Xr ftpd 8 .
|
||||
.Xr ftp 1 .
|
||||
.It Va WITHOUT_GAMES
|
||||
Do not build games.
|
||||
.It Va WITHOUT_GNU_DIFF
|
||||
|
|
@ -1481,10 +1478,9 @@ When set, these options are also in effect:
|
|||
is set explicitly)
|
||||
.El
|
||||
.It Va WITHOUT_PAM_SUPPORT
|
||||
Build some programs without PAM support, particularly
|
||||
.Xr ftpd 8
|
||||
and
|
||||
.Xr ppp 8 .
|
||||
Build
|
||||
.Xr ppp 8
|
||||
without PAM support.
|
||||
.It Va WITHOUT_PF
|
||||
Do not build PF firewall package.
|
||||
When set, it enforces these options:
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd August 18, 2025
|
||||
.Dd September 25, 2025
|
||||
.Dt HIER 7
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -892,9 +892,6 @@ last login log; see
|
|||
.It Pa utx.log
|
||||
login/logout log; see
|
||||
.Xr getutxent 3
|
||||
.It Pa xferlog
|
||||
default log for
|
||||
.Xr ftpd 8
|
||||
.El
|
||||
.Pp
|
||||
.It Pa mail/
|
||||
|
|
@ -952,9 +949,6 @@ serial device locks; see
|
|||
.Xr uucplock 3
|
||||
.It Pa lpd/
|
||||
line printer spooler daemon spool
|
||||
.It Pa ftp/
|
||||
ftp root directory; see
|
||||
.Xr ftpd 8
|
||||
.It Pa mqueue/
|
||||
undelivered mail queue for
|
||||
.Xr sendmail 8
|
||||
|
|
|
|||
|
|
@ -364,7 +364,6 @@ There are a number of other servers that typically do not run in sandboxes:
|
|||
.Xr sendmail 8 ,
|
||||
.Xr popper 8 ,
|
||||
.Xr imapd 8 ,
|
||||
.Xr ftpd 8 ,
|
||||
and others.
|
||||
There are alternatives to
|
||||
some of these, but installing them may require more work than you are willing
|
||||
|
|
|
|||
|
|
@ -52,8 +52,6 @@ and recover files when disks die an untimely death
|
|||
.\" consulted when formatting disks and tapes.
|
||||
Network related services like
|
||||
.Xr inetd 8
|
||||
and
|
||||
.Xr ftpd 8
|
||||
are also described.
|
||||
.Pp
|
||||
All commands set an exit status.
|
||||
|
|
|
|||
|
|
@ -2045,21 +2045,14 @@ OLD_FILES+=usr/share/man/man8/phttpget.8.gz
|
|||
.endif
|
||||
|
||||
.if ${MK_FTP} == no
|
||||
OLD_FILES+=etc/ftpusers
|
||||
OLD_FILES+=etc/newsyslog.conf.d/ftp.conf
|
||||
OLD_FILES+=etc/pam.d/ftp
|
||||
OLD_FILES+=etc/pam.d/ftpd
|
||||
OLD_FILES+=etc/rc.d/ftpd
|
||||
OLD_FILES+=etc/syslog.d/ftp.conf
|
||||
OLD_FILES+=usr/bin/ftp
|
||||
OLD_FILES+=usr/bin/gate-ftp
|
||||
OLD_FILES+=usr/bin/pftp
|
||||
OLD_FILES+=usr/libexec/ftpd
|
||||
OLD_FILES+=usr/share/man/man1/ftp.1.gz
|
||||
OLD_FILES+=usr/share/man/man1/gate-ftp.1.gz
|
||||
OLD_FILES+=usr/share/man/man1/pftp.1.gz
|
||||
OLD_FILES+=usr/share/man/man5/ftpchroot.5.gz
|
||||
OLD_FILES+=usr/share/man/man8/ftpd.8.gz
|
||||
.endif
|
||||
|
||||
.if ${MK_GAMES} == no
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
Build some programs without
|
||||
.Xr libblacklist 3
|
||||
support, like
|
||||
.Xr fingerd 8 ,
|
||||
.Xr ftpd 8 ,
|
||||
.Xr fingerd 8
|
||||
and
|
||||
.Xr sshd 8 .
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
Do not build or install
|
||||
.Xr ftp 1
|
||||
and
|
||||
.Xr ftpd 8 .
|
||||
.Xr ftp 1 .
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
Build some programs without PAM support, particularly
|
||||
.Xr ftpd 8
|
||||
and
|
||||
.Xr ppp 8 .
|
||||
Build
|
||||
.Xr ppp 8
|
||||
without PAM support.
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd September 29, 2022
|
||||
.Dd September 25, 2025
|
||||
.Dt INETD 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
|
|
@ -949,7 +949,7 @@ database.
|
|||
.Xr bootpd 8 ,
|
||||
.Xr comsat 8 ,
|
||||
.Xr fingerd 8 ,
|
||||
.Xr ftpd 8 ,
|
||||
.Xr ftpd 8 Pq Pa ports/ftp/freebsd-ftpd ,
|
||||
.Xr imapd 8 Pq Pa ports/mail/courier-imap ,
|
||||
.Xr nmbd 8 Pq Pa ports/net/samba412 ,
|
||||
.Xr rlogind 8 ,
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
# To disable a service, comment it out by prefixing the line with '#'.
|
||||
# To enable a service, remove the '#' at the beginning of the line.
|
||||
#
|
||||
#ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l
|
||||
#ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l
|
||||
#ftp stream tcp nowait root /usr/local/libexec/ftpd ftpd -l
|
||||
#ftp stream tcp6 nowait root /usr/local/libexec/ftpd ftpd -l
|
||||
#ssh stream tcp nowait root /usr/sbin/sshd sshd -i
|
||||
#ssh stream tcp6 nowait root /usr/sbin/sshd sshd -i
|
||||
#telnet stream tcp nowait root /usr/local/libexec/telnetd telnetd
|
||||
|
|
|
|||
|
|
@ -6,13 +6,6 @@ CONFSDIR= /etc/newsyslog.conf.d
|
|||
CONFGROUPS= CONFS
|
||||
CONFS=
|
||||
|
||||
.if ${MK_FTP} != "no"
|
||||
CONFGROUPS+= FTP
|
||||
FTP+= ftp.conf
|
||||
FTPPACKAGE= ftpd
|
||||
FTPDIR= /etc/newsyslog.conf.d
|
||||
.endif
|
||||
|
||||
.if ${MK_LPR} != "no"
|
||||
CONFGROUPS+= LP
|
||||
LP+= lpr.conf
|
||||
|
|
|
|||
|
|
@ -29,12 +29,6 @@ CFLAGS+= -DINET6
|
|||
|
||||
SYSLOGD_D=
|
||||
SYSLOGD_DDIR= /etc/syslog.d
|
||||
.if ${MK_FTP} != "no"
|
||||
CONFGROUPS+= FTP
|
||||
FTP+= ftp.conf
|
||||
FTPDIR= /etc/syslog.d
|
||||
FTPPACKAGE= ftpd
|
||||
.endif
|
||||
|
||||
.if ${MK_LPR} != "no"
|
||||
CONFGROUPS+= LP
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue