symbols for the platform.
Use logintest to check which symbols are defined before modifying
- configure.in and loginrec.c. (You have to build logintest yourself
+ configure.ac and loginrec.c. (You have to build logintest yourself
with 'make logintest' as it's not built by default.)
Otherwise, patches to the specific method(s) are very helpful!
login_utmp_only(struct logininfo *li)
{
li->type = LTYPE_LOGIN;
+ login_set_current_time(li);
# ifdef USE_UTMP
utmp_write_entry(li);
# endif
if (strncmp(src, "/dev/", 5) == 0)
src += 5;
+#ifdef WITH_ABBREV_NO_TTY
+ if (strncmp(src, "tty", 3) == 0)
+ src += 3;
+#endif
+
len = strlen(src);
if (len > 0) {
switch (li->type) {
case LTYPE_LOGIN:
ut->ut_type = USER_PROCESS;
-#ifdef _CRAY
+#if defined(_CRAY) && !defined(_CRAYSV2)
cray_set_tmpdir(ut);
#endif
break;
case LTYPE_LOGOUT:
ut->ut_type = DEAD_PROCESS;
-#ifdef _CRAY
+#if defined(_CRAY) && !defined(_CRAYSV2)
cray_retain_utmp(ut, li->pid);
#endif
break;
line_stripname(utx->ut_line, li->line, sizeof(utx->ut_line));
set_utmpx_time(li, utx);
utx->ut_pid = li->pid;
+ /* strncpy(): Don't necessarily want null termination */
+ strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
if (li->type == LTYPE_LOGOUT)
return;
* for logouts.
*/
- /* strncpy(): Don't necessarily want null termination */
- strncpy(utx->ut_name, li->username, MIN_SIZEOF(utx->ut_name, li->username));
# ifdef HAVE_HOST_IN_UTMPX
strncpy(utx->ut_host, li->hostname, MIN_SIZEOF(utx->ut_host, li->hostname));
# endif
{
struct utmpx utx;
- memset(&utx, '\0', sizeof(utx));
- set_utmpx_time(li, &utx);
- line_stripname(utx.ut_line, li->line, sizeof(utx.ut_line));
+ construct_utmpx(li, &utx);
# ifdef HAVE_ID_IN_UTMPX
line_abbrevname(utx.ut_id, li->line, sizeof(utx.ut_id));
# endif
}
if (fstat(fd, &st) != 0) {
log("wtmpx_get_entry: couldn't stat %s: %s",
- WTMP_FILE, strerror(errno));
+ WTMPX_FILE, strerror(errno));
close(fd);
return 0;
}
/* Logouts are recorded as a blank username on a particular line.
* So, we just need to find the username in struct utmpx */
if ( wtmpx_islogin(li, &utx) ) {
+ found = 1;
# ifdef HAVE_TV_IN_UTMPX
li->tv_sec = utx.ut_tv.tv_sec;
# else