Pull up following revision(s) (requested by lukem in ticket #1900):
libexec/ftpd/ftpd.8: revision 1.87 libexec/ftpd/ftpd.c: revision 1.204 Add -f option to ftpd to stay in foreground with -D. From nia in PR bin/53221.
This commit is contained in:
parent
c86651f48b
commit
88597528ed
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: ftpd.8,v 1.85 2009/05/01 10:53:27 wiz Exp $
|
||||
.\" $NetBSD: ftpd.8,v 1.85.38.1 2023/10/03 09:54:24 martin Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
@ -65,7 +65,7 @@
|
|||
Internet File Transfer Protocol server
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl 46DdHlnQqrsUuWwX
|
||||
.Op Fl 46DdfHlnQqrsUuWwX
|
||||
.Op Fl a Ar anondir
|
||||
.Op Fl C Ar user Ns Op @ Ns Ar host
|
||||
.Op Fl c Ar confdir
|
||||
|
@ -154,6 +154,10 @@ for the
|
|||
.Dq "\&%E"
|
||||
escape sequence (see
|
||||
.Sx Display file escape sequences )
|
||||
.It Fl f
|
||||
Stops the
|
||||
.Fl D
|
||||
flag from detaching from the tty and going into the background.
|
||||
.It Fl H
|
||||
Equivalent to
|
||||
.Do
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ftpd.c,v 1.203 2016/07/19 21:25:38 shm Exp $ */
|
||||
/* $NetBSD: ftpd.c,v 1.203.6.1 2023/10/03 09:54:24 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1997-2009 The NetBSD Foundation, Inc.
|
||||
|
@ -97,7 +97,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1988, 1990, 1992, 1993, 1994\
|
|||
#if 0
|
||||
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
|
||||
#else
|
||||
__RCSID("$NetBSD: ftpd.c,v 1.203 2016/07/19 21:25:38 shm Exp $");
|
||||
__RCSID("$NetBSD: ftpd.c,v 1.203.6.1 2023/10/03 09:54:24 martin Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -177,6 +177,7 @@ static sig_atomic_t urgflag;
|
|||
|
||||
int data;
|
||||
int Dflag;
|
||||
int fflag;
|
||||
int sflag;
|
||||
int stru; /* avoid C keyword */
|
||||
int mode;
|
||||
|
@ -298,6 +299,7 @@ main(int argc, char *argv[])
|
|||
logging = 0;
|
||||
pdata = -1;
|
||||
Dflag = 0;
|
||||
fflag = 0;
|
||||
sflag = 0;
|
||||
dataport = 0;
|
||||
dopidfile = 1; /* default: DO use a pid file to count users */
|
||||
|
@ -323,7 +325,7 @@ main(int argc, char *argv[])
|
|||
openlog("ftpd", LOG_PID | LOG_NDELAY, LOG_FTP);
|
||||
|
||||
while ((ch = getopt(argc, argv,
|
||||
"46a:c:C:Dde:h:HlL:nP:qQrst:T:uUvV:wWX")) != -1) {
|
||||
"46a:c:C:Dde:fh:HlL:nP:qQrst:T:uUvV:wWX")) != -1) {
|
||||
switch (ch) {
|
||||
case '4':
|
||||
af = AF_INET;
|
||||
|
@ -377,6 +379,10 @@ main(int argc, char *argv[])
|
|||
emailaddr = optarg;
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
fflag = 1;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
strlcpy(hostname, optarg, sizeof(hostname));
|
||||
break;
|
||||
|
@ -505,7 +511,7 @@ main(int argc, char *argv[])
|
|||
struct pollfd *fds;
|
||||
struct addrinfo hints, *res, *res0;
|
||||
|
||||
if (daemon(1, 0) == -1) {
|
||||
if (!fflag && daemon(1, 0) == -1) {
|
||||
syslog(LOG_ERR, "failed to daemonize: %m");
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue