1 --- a/src/racoon/isakmp_cfg.c
2 +++ b/src/racoon/isakmp_cfg.c
4 #include <sys/socket.h>
9 #if defined(__APPLE__) && defined(__MACH__)
12 @@ -1661,7 +1661,8 @@ isakmp_cfg_accounting_system(port, raddr
18 + char term[UT_LINESIZE];
19 char addr[NI_MAXHOST];
21 if (usr == NULL || usr[0]=='\0') {
22 @@ -1670,34 +1671,37 @@ isakmp_cfg_accounting_system(port, raddr
26 - memset(&ut, 0, sizeof ut);
27 - gettimeofday((struct timeval *)&ut.ut_tv, NULL);
28 - snprintf(ut.ut_id, sizeof ut.ut_id, TERMSPEC, port);
29 + sprintf(term, TERMSPEC, port);
32 case ISAKMP_CFG_LOGIN:
33 - ut.ut_type = USER_PROCESS;
34 - strncpy(ut.ut_user, usr, sizeof ut.ut_user);
35 + strncpy(ut.ut_name, usr, UT_NAMESIZE);
36 + ut.ut_name[UT_NAMESIZE - 1] = '\0';
38 + strncpy(ut.ut_line, term, UT_LINESIZE);
39 + ut.ut_line[UT_LINESIZE - 1] = '\0';
41 GETNAMEINFO_NULL(raddr, addr);
42 - strncpy(ut.ut_host, addr, sizeof ut.ut_host);
43 + strncpy(ut.ut_host, addr, UT_HOSTSIZE);
44 + ut.ut_host[UT_HOSTSIZE - 1] = '\0';
46 + ut.ut_time = time(NULL);
48 plog(LLV_INFO, LOCATION, NULL,
49 "Accounting : '%s' logging on '%s' from %s.\n",
50 - ut.ut_user, ut.ut_id, addr);
53 + ut.ut_name, ut.ut_line, ut.ut_host);
58 case ISAKMP_CFG_LOGOUT:
59 - ut.ut_type = DEAD_PROCESS;
61 plog(LLV_INFO, LOCATION, NULL,
62 "Accounting : '%s' unlogging from '%s'.\n",
72 plog(LLV_ERROR, LOCATION, NULL, "Unepected inout\n");