diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-11-30 09:17:30 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-11-30 09:17:30 +0100 |
commit | 58c3d21c2e3caa5e5f3736a72136903dbf3c69d1 (patch) | |
tree | a797659ba367ad6c4277074c406af1c8b068300f /networking/telnetd.c | |
parent | 3c8799b8a45def567705bfd07b8745e99d5f2dd9 (diff) | |
download | busybox-w32-58c3d21c2e3caa5e5f3736a72136903dbf3c69d1.tar.gz busybox-w32-58c3d21c2e3caa5e5f3736a72136903dbf3c69d1.tar.bz2 busybox-w32-58c3d21c2e3caa5e5f3736a72136903dbf3c69d1.zip |
telnetd: write utmp record with correct pid
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/telnetd.c')
-rw-r--r-- | networking/telnetd.c | 3 |
1 files changed, 2 insertions, 1 deletions
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( | |||
314 | /* Restore default signal handling ASAP */ | 314 | /* Restore default signal handling ASAP */ |
315 | bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); | 315 | bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); |
316 | 316 | ||
317 | pid = getpid(); | ||
318 | |||
317 | if (ENABLE_FEATURE_UTMP) { | 319 | if (ENABLE_FEATURE_UTMP) { |
318 | len_and_sockaddr *lsa = get_peer_lsa(sock); | 320 | len_and_sockaddr *lsa = get_peer_lsa(sock); |
319 | char *hostname = NULL; | 321 | char *hostname = NULL; |
@@ -335,7 +337,6 @@ make_new_session( | |||
335 | xopen(tty_name, O_RDWR); /* becomes our ctty */ | 337 | xopen(tty_name, O_RDWR); /* becomes our ctty */ |
336 | xdup2(0, 1); | 338 | xdup2(0, 1); |
337 | xdup2(0, 2); | 339 | xdup2(0, 2); |
338 | pid = getpid(); | ||
339 | tcsetpgrp(0, pid); /* switch this tty's process group to us */ | 340 | tcsetpgrp(0, pid); /* switch this tty's process group to us */ |
340 | 341 | ||
341 | /* The pseudo-terminal allocated to the client is configured to operate | 342 | /* The pseudo-terminal allocated to the client is configured to operate |