summaryrefslogtreecommitdiff
path: root/security/ipsec-tools/files/patch8-utmp.diff
diff options
context:
space:
mode:
authorFlorian Smeets <flo@FreeBSD.org>2011-03-23 19:48:10 +0000
committerFlorian Smeets <flo@FreeBSD.org>2011-03-23 19:48:10 +0000
commit8a131b63e8a0d05585a5635002abb10a2d1dad5a (patch)
tree25ef77f734fcd51100825fe571e10f606096cb70 /security/ipsec-tools/files/patch8-utmp.diff
parent- Update to 0.13.60 (diff)
- update to 0.8.0
PR: ports/155883 Submitted by: vanhu (maintainer)
Diffstat (limited to 'security/ipsec-tools/files/patch8-utmp.diff')
-rw-r--r--security/ipsec-tools/files/patch8-utmp.diff69
1 files changed, 69 insertions, 0 deletions
diff --git a/security/ipsec-tools/files/patch8-utmp.diff b/security/ipsec-tools/files/patch8-utmp.diff
new file mode 100644
index 000000000000..db37400f4319
--- /dev/null
+++ b/security/ipsec-tools/files/patch8-utmp.diff
@@ -0,0 +1,69 @@
+--- src/racoon/isakmp_cfg.c 21 Sep 2010 13:14:17 -0000 1.24
++++ src/racoon/isakmp_cfg.c 4 Aug 2010 09:16:58 -0000 1.23
+@@ -38,7 +38,7 @@
+ #include <sys/socket.h>
+ #include <sys/queue.h>
+
+-#include <utmpx.h>
++#include <utmp.h>
+ #if defined(__APPLE__) && defined(__MACH__)
+ #include <util.h>
+ #endif
+@@ -1661,7 +1661,8 @@ isakmp_cfg_accounting_system(port, raddr
+ int inout;
+ {
+ int error = 0;
+- struct utmpx ut;
++ struct utmp ut;
++ char term[UT_LINESIZE];
+ char addr[NI_MAXHOST];
+
+ if (usr == NULL || usr[0]=='\0') {
+@@ -1670,33 +1671,36 @@ isakmp_cfg_accounting_system(port, raddr
+ return -1;
+ }
+
+- memset(&ut, 0, sizeof ut);
+- gettimeofday((struct timeval *)&ut.ut_tv, NULL);
+- snprintf(ut.ut_id, sizeof ut.ut_id, TERMSPEC, port);
++ sprintf(term, TERMSPEC, port);
+
+ switch (inout) {
+ case ISAKMP_CFG_LOGIN:
+- ut.ut_type = USER_PROCESS;
+- strncpy(ut.ut_user, usr, sizeof ut.ut_user);
++ strncpy(ut.ut_name, usr, UT_NAMESIZE);
++ ut.ut_name[UT_NAMESIZE - 1] = '\0';
++
++ strncpy(ut.ut_line, term, UT_LINESIZE);
++ ut.ut_line[UT_LINESIZE - 1] = '\0';
+
+ GETNAMEINFO_NULL(raddr, addr);
+- strncpy(ut.ut_host, addr, sizeof ut.ut_host);
++ strncpy(ut.ut_host, addr, UT_HOSTSIZE);
++ ut.ut_host[UT_HOSTSIZE - 1] = '\0';
+
++ ut.ut_time = time(NULL);
++
+ plog(LLV_INFO, LOCATION, NULL,
+ "Accounting : '%s' logging on '%s' from %s.\n",
+- ut.ut_user, ut.ut_id, addr);
++ ut.ut_name, ut.ut_line, ut.ut_host);
+
+- pututxline(&ut);
++ login(&ut);
+
+ break;
+ case ISAKMP_CFG_LOGOUT:
+- ut.ut_type = DEAD_PROCESS;
+
+ plog(LLV_INFO, LOCATION, NULL,
+ "Accounting : '%s' unlogging from '%s'.\n",
+- usr, ut.ut_id);
++ usr, term);
+
+- pututxline(&ut);
++ logout(term);
+
+ break;
+ default: