Date: Tue, 16 Feb 2010 08:57:30 +0300 From: "Andrey V. Elsukov" <bu7cher@yandex.ru> To: ticso@cicely.de Cc: Alexander Motin <mav@FreeBSD.org>, Bernd Walter <ticso@cicely7.cicely.de>, current@freebsd.org Subject: Re: ports/net/mpd[45] broken with utmpx.h change Message-ID: <4B7A33CA.4080705@yandex.ru> In-Reply-To: <20100216015121.GC43625@cicely7.cicely.de> References: <20100216015121.GC43625@cicely7.cicely.de>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------040708040202040300010708 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit On 16.02.2010 4:51, Bernd Walter wrote: > I don't know how difficult it is to fix, but for many of us mpd is > important to have network connection. You can try this patch. I don't know why Alexander did't commit it. -- WBR, Andrey V. Elsukov --------------040708040202040300010708 Content-Type: text/plain; name="patch-utmpx.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch-utmpx.diff" --- 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 <opie.h> #endif +#if __FreeBSD_version >= 900007 +#include <utmpx.h> +#else #include <utmp.h> +#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); --------------040708040202040300010708--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B7A33CA.4080705>