From owner-freebsd-questions@FreeBSD.ORG Wed Jul 21 14:37:30 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE4181065673; Wed, 21 Jul 2010 14:37:30 +0000 (UTC) (envelope-from rehsack@googlemail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 40D7E8FC20; Wed, 21 Jul 2010 14:37:29 +0000 (UTC) Received: by wwe15 with SMTP id 15so2001066wwe.31 for ; Wed, 21 Jul 2010 07:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=HjHiBU2IregCMznYsY9STnXNlBV6aqDSV/zdGW2yuos=; b=tLQ4O5M/EEsnpMN8bJOAG7cXCH1OJf2PsFZJ9lkWdGvOkTcLy46faCTnqdc0T/ZdIV Z/ajGDaVVOYSMSUrfzrLDpK95C+OrLjYq7NjXyBf79k6UcN3zFYwtwujnReyhCCrkZEY D62+UfTpHIsTEKSYZZwbEHf/U+CiuynoerU2g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=XBKmPb9QGbu1TZ/+pFjkQQwkTmzBZ/jfZcswSyaXG6lYTLzGVkgDFeHDpjyhadFgQn 7Iyfc7ARFvQXemG/DLuthEaBV45cDxVwHiBuVNGM7V47VKiyWzL5C4iiuQ1F/augEyUH ClaWK6WkIK4DqwjBPTE204p8AbhtGvVXDUpwg= Received: by 10.227.129.12 with SMTP id m12mr254967wbs.102.1279723048989; Wed, 21 Jul 2010 07:37:28 -0700 (PDT) Received: from waldorf.muppets.liwing.de (p4FF87BF1.dip.t-dialin.net [79.248.123.241]) by mx.google.com with ESMTPS id e31sm52464292wbe.17.2010.07.21.07.37.27 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 21 Jul 2010 07:37:28 -0700 (PDT) Message-ID: <4C470615.8030608@netbsd.org> Date: Wed, 21 Jul 2010 14:37:09 +0000 From: Jens Rehsack User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100409 Thunderbird/3.0.4 MIME-Version: 1.0 To: Dan Nelson References: <20100715172615.GC5485@dan.emsphone.com> <86tyo0qd19.fsf@chateau.d.if> <20100716043056.GF5485@dan.emsphone.com> <20100716150719.GG5485@dan.emsphone.com> <4C408744.3030409@netbsd.org> <20100716181316.GH5485@dan.emsphone.com> In-Reply-To: <20100716181316.GH5485@dan.emsphone.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Ashish SHUKLA , freebsd-questions@freebsd.org Subject: Re: getpwent bug? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jul 2010 14:37:30 -0000 On 07/16/10 18:13, Dan Nelson wrote: Hi Dan, > In the last episode (Jul 16), Jens Rehsack said: >> On 07/16/10 15:07, Dan Nelson wrote: >>> In the last episode (Jul 16), Jens Rehsack said: >>>> Could you please take a look to my other mail (getgrent related) - there >>>> seems another bug ... >>> >>> Do you have another one-liner that will reproduce it? A simple >>> "/usr/bin/getent group" doesn't return dupes for me. Oddly enough, the >>> *grent code doesn't use an internal counter, so the bug you found in >>> endpwent doesn't exist in endgrent (afaik; the nsswitch code isn't that >>> easy to read). >> >> Not really a one-liner: >> perl -MData::Dumper -e 'setgrent; my %dupchk; while( my ( $name, $grpass, >> $gid, $members ) = getgrent() ) { print "$name is returned more than once >> (No $dupchk{$name} comes here)\n" if( $dupchk{$name}++ ); print Dumper( [ >> $name, $grpass, $gid, $members ] ) };' >> >> setgrent() doesn't work here. > > I ran that and got dupes for group entries that exist both in /etc/groups and > my LDAP source, but that's expected. You can see here http://www.cpantesters.org/cpan/report/f5100ac6-9418-11df-9ebc-c4a68065c34d the typical error picture. FreeBSD is the only system, where this error occurs. I rate it as a bug - but I will write merge code for the duplicated entries. Best regards, Jens