From: Denys Vlasenko Date: Tue, 30 Nov 2010 08:17:30 +0000 (+0100) Subject: telnetd: write utmp record with correct pid X-Git-Tag: 1_19_0~479 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=58c3d21c2e3caa5e5f3736a72136903dbf3c69d1;p=oweals%2Fbusybox.git telnetd: write utmp record with correct pid Signed-off-by: Denys Vlasenko --- diff --git a/networking/telnetd.c b/networking/telnetd.c index 671529d37..07c6a6a73 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