--- SimplePAMApps-0.60/common/lib/wtmp.c Fri Mar 1 23:14:57 2002 +++ SimplePAMApps-0.60/common/lib/wtmp.c Fri Mar 1 23:14:57 2002 @@ -3,6 +3,9 @@ */ #define RHOST_UNKNOWN_NAME "" /* perhaps "[from.where?]" */ + +#define DEVICE_FILE_PREFIX "/dev/" + #define WTMP_LOCK_TIMEOUT 3 /* in seconds */ #include @@ -47,6 +50,7 @@ while ((u_tmp_p = getutent()) != NULL) if ((u_tmp_p->ut_type == INIT_PROCESS || u_tmp_p->ut_type == LOGIN_PROCESS || + u_tmp_p->ut_type == DEAD_PROCESS || u_tmp_p->ut_type == USER_PROCESS) && !strncmp(u_tmp_p->ut_line, ut_line, UT_LINESIZE)) { if (!strncmp(u_tmp_p->ut_id, ut_id, UT_IDSIZE)) @@ -81,18 +85,13 @@ if ( *terminal == '/' ) { /* now deal with filenames */ int o1, o2; - o1 = strncmp("/dev/", terminal, 5) ? 0 : 5; + o1 = strncmp(DEVICE_FILE_PREFIX, terminal, 5) ? 0 : 5; if (!strncmp("/dev/tty", terminal, 8)) { o2 = 8; } else { - if (!strncmp("/dev/pts/", terminal, 9)) - o1 = 8; /* include the slash */ - o2 = strlen(terminal + o1) - UT_IDSIZE; + o2 = strlen(terminal) - sizeof(UT_IDSIZE); if (o2 < 0) o2 = 0; - o2 += o1; - if (o1 > 5) - o1 = 5; } strncpy(ut_line, terminal + o1, UT_LINESIZE);