1 diff -ur utempter-0.5.2.orig/utempter.c utempter-0.5.2/utempter.c
2 --- utempter-0.5.2.orig/utempter.c Thu Apr 8 18:19:36 1999
3 +++ utempter-0.5.2/utempter.c Fri May 5 04:19:51 2000
11 if (argc < 3) usage();
17 + memset(&ll, 0, sizeof(ll));
18 memset(&utx, 0, sizeof(utx));
20 utx.ut_type = USER_PROCESS;
24 strncpy(utx.ut_line, device + 5, sizeof(utx.ut_line));
25 + strncpy(ll.ll_line, device + 5, sizeof(ll.ll_line));
27 pw = getpwuid(getuid());
31 strncpy(utx.ut_user, pw->pw_name, sizeof(utx.ut_user));
35 strncpy(utx.ut_host, host, sizeof(utx.ut_host));
36 + strncpy(ll.ll_host, host, sizeof(ll.ll_host));
39 if (!strncmp("pts/", utx.ut_line, 4)) {
42 strncpy(utx.ut_id, id, sizeof(utx.ut_id));
44 gettimeofday(&utx.ut_tv, NULL);
45 + ll.ll_time = time(NULL);
48 updwtmpx(_PATH_WTMP, &utx);
50 + if ((fd = open(_PATH_LASTLOG, O_RDWR)) != -1) {
51 + lseek(fd, (off_t) ((long)pw->pw_uid * sizeof(ll)), SEEK_SET);
52 + write(fd, &ll, sizeof(ll));