--- src/auth.c 2009-12-22 12:02:46.000000000 +0300 +++ src/auth.c 2010-01-18 15:01:25.918302237 +0300 @@ -1387,6 +1387,30 @@ * Account with system */ +#if __FreeBSD_version >= 900007 +static int +AuthSystemAcct(AuthData auth) +{ + struct utmpx ut; + + memset(&ut, 0, sizeof(ut)); + snprintf(ut.ut_id, sizeof(ut.ut_id), "%xmpd", auth->info.linkID); + + if (auth->acct_type == AUTH_ACCT_START) { + ut.ut_type = USER_PROCESS; + strlcpy(ut.ut_host, auth->params.peeraddr, sizeof(ut.ut_host)); + strlcpy(ut.ut_user, auth->params.authname, sizeof(ut.ut_user)); + gettimeofday(&ut.ut_tv, NULL); + Log(LG_AUTH, ("[%s] ACCT: wtmp %s %s %s login", auth->info.lnkname, ut.ut_line, + ut.ut_user, ut.ut_host)); + } else if (auth->acct_type == AUTH_ACCT_STOP) { + ut.ut_type = DEAD_PROCESS; + Log(LG_AUTH, ("[%s] ACCT: wtmp %s logout", auth->info.lnkname, ut.ut_line)); + } + pututxline(&ut); + return (0); +} +#else static int AuthSystemAcct(AuthData auth) { @@ -1412,6 +1436,7 @@ } return (0); } +#endif /* __FreeBSD_version >= 900007 */ #endif /* USE_SYSTEM */ #ifdef USE_PAM --- src/auth.h 2009-12-22 12:02:46.000000000 +0300 +++ src/auth.h 2010-01-18 14:44:22.471540149 +0300 @@ -23,7 +23,11 @@ #ifdef USE_OPIE #include #endif +#if __FreeBSD_version >= 900007 +#include +#else #include +#endif /* * DEFINITIONS @@ -303,8 +307,10 @@ extern const char *AuthMPPEPolicyname(int policy); extern const char *AuthMPPETypesname(int types, char *buf, size_t len); +#if defined(USE_NG_BPF) || defined(USE_IPFW) extern void ACLCopy(struct acl *src, struct acl **dst); extern void ACLDestroy(struct acl *acl); +#endif extern void authparamsInit(struct authparams *ap); extern void authparamsCopy(struct authparams *src, struct authparams *dst); extern void authparamsMove(struct authparams *src, struct authparams *dst);