getpwent bug?

2010-07-15 Thread Jens Rehsack
Hi all, I detected an issue with getpwent on my FreeBSD test box: perl -MData::Dumper -e 'my @e = getpwent(); print Dumper(\...@e); endpwent(); @e = getpwent(); print Dumper(\...@e); endpwent(); @e = getpwent(); print Dumper(\...@e); endpwent();' $VAR1 = [ 'root', '',

Re: getpwent bug?

2010-07-15 Thread Dan Nelson
In the last episode (Jul 15), Jens Rehsack said: > Hi all, > > I detected an issue with getpwent on my FreeBSD test box: > > perl -MData::Dumper -e 'my @e = getpwent(); print Dumper(\...@e); endpwent(); > @e = getpwent(); print Dumper(\...@e); endpwent(); @e = getpwent(); print > Dumper(\...@e)

Re: getpwent bug?

2010-07-15 Thread Ashish SHUKLA
Dan Nelson writes: > In the last episode (Jul 15), Jens Rehsack said: >> Hi all, >> >> I detected an issue with getpwent on my FreeBSD test box: >> >> perl -MData::Dumper -e 'my @e = getpwent(); print Dumper(\...@e); >> endpwent(); @e = getpwent(); print Dumper(\...@e); endpwent(); @e = >> getp

Re: getpwent bug?

2010-07-15 Thread Dan Nelson
In the last episode (Jul 16), Ashish SHUKLA said: > Dan Nelson writes: > > In the last episode (Jul 15), Jens Rehsack said: > >> Hi all, > >> > >> I detected an issue with getpwent on my FreeBSD test box: > >> > >> perl -MData::Dumper -e 'my @e = getpwent(); print Dumper(\...@e); > >> endpwent()

Re: getpwent bug?

2010-07-15 Thread Jens Rehsack
2010/7/16 Dan Nelson : > In the last episode (Jul 16), Ashish SHUKLA said: >> Dan Nelson writes: >> > In the last episode (Jul 15), Jens Rehsack said: >> >> Hi all, >> >> >> >> I detected an issue with getpwent on my FreeBSD test box: >> >> >> >> perl -MData::Dumper -e 'my @e = getpwent(); print Du

Re: getpwent bug?

2010-07-16 Thread Ashish SHUKLA
Jens Rehsack writes: > 2010/7/16 Dan Nelson : [...] >> Try the following patch: Thanks, I'll try it when I'm on my FreeBSD box. > Can I do this without a full world rebuild? (I do not develop in FBSD > actively). > Otherwise I recommend (the test case was in OP) that someone with a > separate

Re: getpwent bug?

2010-07-16 Thread Jens Rehsack
On 07/16/10 08:36, Ashish SHUKLA wrote: Jens Rehsack writes: 2010/7/16 Dan Nelson: [...] Try the following patch: Thanks, I'll try it when I'm on my FreeBSD box. Great \o/ [...] I had to develop a workaround for all other boxes anyway. As a workaround you can use setpwent(3). I c

Re: getpwent bug?

2010-07-16 Thread Ashish SHUKLA
Jens Rehsack writes: [...] > I cached the entires - I rate setpwent as to dangerous. dangerous ? why ? > You can take a look at > http://cpansearch.perl.org/src/REHSACK/DBD-Sys-0.01_01/lib/DBD/Sys/Plugin/Unix/Users.pm > Jens -- Ashish SHUKLA | GPG: F682 CDCC 39DC 0FEA E116 20B6 C746 C

Re: getpwent bug?

2010-07-16 Thread Jens Rehsack
On 07/16/10 09:12, Ashish SHUKLA wrote: Jens Rehsack writes: [...] I cached the entires - I rate setpwent as to dangerous. dangerous ? why ? Because it modifies something - and I might not know the source. getpwent(3) delivers entries from yp, too (or LDAP) etc. - and when I call setpwent(

Re: getpwent bug?

2010-07-16 Thread Ashish SHUKLA
Jens Rehsack writes: > On 07/16/10 09:12, Ashish SHUKLA wrote: >> Jens Rehsack writes: >> >> [...] >> >>> I cached the entires - I rate setpwent as to dangerous. >> >> dangerous ? why ? > Because it modifies something - and I might not know the source. > getpwent(3) delivers entries from yp, to

Re: getpwent bug?

2010-07-16 Thread Jens Rehsack
On 07/16/10 09:59, Ashish SHUKLA wrote: Jens Rehsack writes: On 07/16/10 09:12, Ashish SHUKLA wrote: Jens Rehsack writes: [...] I cached the entires - I rate setpwent as to dangerous. dangerous ? why ? Because it modifies something - and I might not know the source. getpwent(3) delivers

Re: getpwent bug?

2010-07-16 Thread Ashish SHUKLA
Jens Rehsack writes: [...] > You're absolutely right - I never took a deeper look, because I always > was only interested to read the (user|group) data and expected setpwent > to modify such an entry. Its UNIX :P > A quick look into Stevens "Advanced Programming in the UNIX environment" > coul

Re: getpwent bug?

2010-07-16 Thread Dan Nelson
In the last episode (Jul 16), Jens Rehsack said: > 2010/7/16 Dan Nelson : > > In the last episode (Jul 16), Ashish SHUKLA said: > >> Well, OP is also invoking 'endpwent()' after every 'getpwent()' > >> invocation which according to GNU/Linux's glibc and NetBSD's libc (as > >> OP mentioned) should r

Re: getpwent bug?

2010-07-16 Thread Jens Rehsack
On 07/16/10 15:07, Dan Nelson wrote: In the last episode (Jul 16), Jens Rehsack said: 2010/7/16 Dan Nelson: In the last episode (Jul 16), Ashish SHUKLA said: Well, OP is also invoking 'endpwent()' after every 'getpwent()' invocation which according to GNU/Linux's glibc and NetBSD's libc (as OP

Re: getpwent bug?

2010-07-16 Thread Dan Nelson
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 repro

Re: getpwent bug?

2010-07-16 Thread Jens Rehsack
On 07/16/10 18:13, Dan Nelson wrote: 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-l

Re: getpwent bug?

2010-07-21 Thread Jens Rehsack
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 ano

Re: getpwent bug?

2010-07-21 Thread Dan Nelson
In the last episode (Jul 21), Jens Rehsack said: > 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 oth

Re: getpwent bug?

2010-07-21 Thread Jens Rehsack
2010/7/21 Dan Nelson : > In the last episode (Jul 21), Jens Rehsack said: >> 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 y