Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/networking/telnetd.c

    r3232 r3621  
    4545
    4646#include "libbb.h"
     47#include "common_bufsiz.h"
    4748#include <syslog.h>
    4849
     
    8384    int maxfd;
    8485} FIX_ALIASING;
    85 #define G (*(struct globals*)&bb_common_bufsiz1)
     86#define G (*(struct globals*)bb_common_bufsiz1)
    8687#define INIT_G() do { \
     88    setup_common_bufsiz(); \
    8789    G.loginpath = "/bin/login"; \
    8890    G.issuefile = "/etc/issue.net"; \
     
    266268
    267269    /* SO_KEEPALIVE by popular demand */
    268     setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &const_int_1, sizeof(const_int_1));
     270    setsockopt_keepalive(sock);
    269271#if ENABLE_FEATURE_TELNETD_STANDALONE
    270272    ts->sockfd_read = sock;
     
    463465            if (ts->shell_pid == pid) {
    464466                ts->shell_pid = -1;
    465 // man utmp:
    466 // When init(8) finds that a process has exited, it locates its utmp entry
    467 // by ut_pid, sets ut_type to DEAD_PROCESS, and clears ut_user, ut_host
    468 // and ut_time with null bytes.
    469 // [same applies to other processes which maintain utmp entries, like telnetd]
    470 //
    471 // We do not bother actually clearing fields:
    472 // it might be interesting to know who was logged in and from where
    473                 update_utmp(pid, DEAD_PROCESS, /*tty_name:*/ NULL, /*username:*/ NULL, /*hostname:*/ NULL);
     467                update_utmp_DEAD_PROCESS(pid);
    474468                break;
    475469            }
     
    740734 kill_session:
    741735        if (ts->shell_pid > 0)
    742             update_utmp(ts->shell_pid, DEAD_PROCESS, /*tty_name:*/ NULL, /*username:*/ NULL, /*hostname:*/ NULL);
     736            update_utmp_DEAD_PROCESS(ts->shell_pid);
    743737        free_session(ts);
    744738        ts = next;
Note: See TracChangeset for help on using the changeset viewer.