From owner-freebsd-current@FreeBSD.ORG Tue Feb 16 06:09:04 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC81010656C0 for ; Tue, 16 Feb 2010 06:09:03 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward13.mail.yandex.net (forward13.mail.yandex.net [95.108.130.120]) by mx1.freebsd.org (Postfix) with ESMTP id 992808FC21 for ; Tue, 16 Feb 2010 06:09:03 +0000 (UTC) Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward13.mail.yandex.net (Yandex) with ESMTP id 7D979A798AE; Tue, 16 Feb 2010 08:57:33 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1266299853; bh=hIJTDuRjUBmfDcPoAPMbTRP7LR4NJq3WTSfmmjPShjE=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type; b=qt2OTKTdAQpY3piZ39DmYXfzXhjeQGB9haKbb9fPGZ6BYDNI0gx1I9WwDTGd+h7Rp Ow0E1uYTnZcQLLSn45Xt3Zrx8+V5IKYGtOOPt0z9NyTxszD5l0KZN26iZg79KPXlis L6S0Ow6KF4Se19GAA0C3Ul4EPDoTSBjLIF2ziGyw= Received: from [127.0.0.1] (ns.kirov.so-ups.ru [77.72.136.145]) by smtp4.mail.yandex.net (Yandex) with ESMTPSA id C2815D30116; Tue, 16 Feb 2010 08:57:31 +0300 (MSK) Message-ID: <4B7A33CA.4080705@yandex.ru> Date: Tue, 16 Feb 2010 08:57:30 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: ticso@cicely.de References: <20100216015121.GC43625@cicely7.cicely.de> In-Reply-To: <20100216015121.GC43625@cicely7.cicely.de> Content-Type: multipart/mixed; boundary="------------040708040202040300010708" X-Yandex-TimeMark: 1266299852 X-Yandex-Spam: 1 X-Yandex-Front: smtp4.mail.yandex.net Cc: Alexander Motin , Bernd Walter , current@freebsd.org Subject: Re: ports/net/mpd[45] broken with utmpx.h change X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 06:09:04 -0000 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 #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); --------------040708040202040300010708--