summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1999-12-01 06:33:24 +0000
committermillert <millert@openbsd.org>1999-12-01 06:33:24 +0000
commitd3176278f8f07f254404db1d2498d2465638480f (patch)
treeff5c8e1281d25c8dba15532fe5e9469bdb4b8158
parentRemove duplicate #include. (diff)
downloadwireguard-openbsd-d3176278f8f07f254404db1d2498d2465638480f.tar.xz
wireguard-openbsd-d3176278f8f07f254404db1d2498d2465638480f.zip
Move initialization of ttyline to be after the fork() so that when
we are in daemon mode it contains the pid of the child, not the parent. This fixes utmp/wtmp updates in daemon mode.
-rw-r--r--libexec/ftpd/ftpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 98bc1a7fd45..f319b5500e1 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.59 1999/11/29 20:17:09 millert Exp $ */
+/* $OpenBSD: ftpd.c,v 1.60 1999/12/01 06:33:24 millert Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -265,9 +265,6 @@ main(argc, argv, envp)
tzset(); /* in case no timezone database in ~ftp */
- /* set this here so klogin can use it... */
- (void)snprintf(ttyline, sizeof(ttyline), "ftp%d", getpid());
-
while ((ch = getopt(argc, argv, argstr)) != -1) {
switch (ch) {
case 'A':
@@ -428,6 +425,9 @@ main(argc, argv, envp)
}
}
+ /* set this here so klogin can use it... */
+ (void)snprintf(ttyline, sizeof(ttyline), "ftp%d", getpid());
+
(void) signal(SIGHUP, sigquit);
(void) signal(SIGINT, sigquit);
(void) signal(SIGQUIT, sigquit);