Date: Fri, 16 Jul 2010 13:13:16 -0500 From: Dan Nelson <dnelson@allantgroup.com> To: Jens Rehsack <rehsack@googlemail.com> Cc: Ashish SHUKLA <ashish@freebsd.org>, freebsd-questions@freebsd.org Subject: Re: getpwent bug? Message-ID: <20100716181316.GH5485@dan.emsphone.com> In-Reply-To: <4C408744.3030409@netbsd.org> References: <AANLkTin5RGYfu_Xt5HWxKFO8GMTOi3YWQ8dyr95ZDW-Y@mail.gmail.com> <20100715172615.GC5485@dan.emsphone.com> <86tyo0qd19.fsf@chateau.d.if> <20100716043056.GF5485@dan.emsphone.com> <AANLkTilSum3vumQhv4qtOQhCaSHo832Ub3b9bEhP0zSt@mail.gmail.com> <20100716150719.GG5485@dan.emsphone.com> <4C408744.3030409@netbsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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. -- Dan Nelson dnelson@allantgroup.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100716181316.GH5485>