summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2010-11-30 09:17:30 +0100
committerDenys Vlasenko2010-11-30 09:17:30 +0100
commit58c3d21c2e3caa5e5f3736a72136903dbf3c69d1 (patch)
treea797659ba367ad6c4277074c406af1c8b068300f /networking
parent3c8799b8a45def567705bfd07b8745e99d5f2dd9 (diff)
downloadbusybox-58c3d21c2e3caa5e5f3736a72136903dbf3c69d1.zip
busybox-58c3d21c2e3caa5e5f3736a72136903dbf3c69d1.tar.gz
telnetd: write utmp record with correct pid
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/telnetd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 671529d..07c6a6a 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -314,6 +314,8 @@ make_new_session(
/* Restore default signal handling ASAP */
bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL);
+ pid = getpid();
+
if (ENABLE_FEATURE_UTMP) {
len_and_sockaddr *lsa = get_peer_lsa(sock);
char *hostname = NULL;
@@ -335,7 +337,6 @@ make_new_session(
xopen(tty_name, O_RDWR); /* becomes our ctty */
xdup2(0, 1);
xdup2(0, 2);
- pid = getpid();
tcsetpgrp(0, pid); /* switch this tty's process group to us */
/* The pseudo-terminal allocated to the client is configured to operate