summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2004-11-28 19:12:31 +0000
committerhenning <henning@openbsd.org>2004-11-28 19:12:31 +0000
commitf78181489ab1c9defd243a1ce65ebc93ed550f81 (patch)
tree2bf118f01028ce756b51c583751c86e339f510f7
parentsync (diff)
downloadwireguard-openbsd-f78181489ab1c9defd243a1ce65ebc93ed550f81.tar.xz
wireguard-openbsd-f78181489ab1c9defd243a1ce65ebc93ed550f81.zip
fix ttyline setting, fixes proctitle.
notice independently by theo and pval, fix from moritz jodeit
-rw-r--r--libexec/ftpd/ftpd.c6
-rw-r--r--libexec/ftpd/monitor.c7
2 files changed, 9 insertions, 4 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index cc1d11f67e8..d867331ff30 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.156 2004/11/28 18:49:29 henning Exp $ */
+/* $OpenBSD: ftpd.c,v 1.157 2004/11/28 19:12:31 henning Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -70,7 +70,7 @@ static const char copyright[] =
static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94";
#else
static const char rcsid[] =
- "$OpenBSD: ftpd.c,v 1.156 2004/11/28 18:49:29 henning Exp $";
+ "$OpenBSD: ftpd.c,v 1.157 2004/11/28 19:12:31 henning Exp $";
#endif
#endif /* not lint */
@@ -178,7 +178,7 @@ char hostname[MAXHOSTNAMELEN];
char remotehost[MAXHOSTNAMELEN];
char dhostname[MAXHOSTNAMELEN];
char *guestpw;
-static char ttyline[20];
+char ttyline[20];
char *tty = ttyline; /* for klogin */
static struct utmp utmp; /* for utmp */
static login_cap_t *lc;
diff --git a/libexec/ftpd/monitor.c b/libexec/ftpd/monitor.c
index b3d97db2f68..d0c06b4b3cb 100644
--- a/libexec/ftpd/monitor.c
+++ b/libexec/ftpd/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.1 2004/11/28 18:49:30 henning Exp $ */
+/* $OpenBSD: monitor.c,v 1.2 2004/11/28 19:12:31 henning Exp $ */
/*
* Copyright (c) 2004 Moritz Jodeit <moritz@jodeit.org>
@@ -50,6 +50,7 @@ enum monitor_state {
#ifdef HASSETPROCTITLE
extern char remotehost[];
#endif
+extern char ttyline[20];
extern int debug;
extern void set_slave_signals(void);
@@ -226,6 +227,10 @@ monitor_post_auth()
slave_pid = fork();
if (slave_pid == -1)
fatalx("fork of user-privileged slave failed");
+
+ snprintf(ttyline, sizeof(ttyline), "ftp%ld",
+ slave_pid == 0 ? (long)getpid() : (long)slave_pid);
+
if (slave_pid == 0) {
/* User privileged slave */
close(fd_slave);