getpwent bug?
    Jens Rehsack 
    rehsack at googlemail.com
       
    Thu Jul 15 12:15:47 UTC 2010
    
    
  
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',
          '',
          0,
          0,
          0,
          '',
          'Charlie &',
          '/root',
          '/bin/csh',
          0
        ];
$VAR1 = [
          'toor',
          '*',
          0,
          0,
          0,
          '',
          'Bourne-again Superuser',
          '/root',
          '',
          0
        ];
$VAR1 = [
          'daemon',
          '*',
          1,
          1,
          0,
          '',
          'Owner of many system processes',
          '/root',
          '/usr/sbin/nologin',
          0
        ];
I'm using FreeBSD waldorf.muppets.liwing.de 7.3-PRERELEASE FreeBSD
7.3-PRERELEASE #0: Fri Mar 12 11:31:18 UTC 2010
root at waldorf.muppets.liwing.de:/usr/obj/usr/src/sys/WALDORF  amd64
The correct output should be (taken from a NetBSD system):
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',
          '*',
          0,
          0,
          0,
          '',
          'Charlie &',
          '/root',
          '/bin/ksh',
          0
        ];
$VAR1 = [
          'root',
          '*',
          0,
          0,
          0,
          '',
          'Charlie &',
          '/root',
          '/bin/ksh',
          0
        ];
$VAR1 = [
          'root',
          '*',
          0,
          0,
          0,
          '',
          'Charlie &',
          '/root',
          '/bin/ksh',
          0
        ];
Taking a look to
http://www.cpantesters.org/distro/D/DBD-Sys.html#DBD-Sys-0.01, this
issue is not limited to FreeBSD 7.3 - it occures on FreeBSD 7.2 and
8.0, too.
I tried several perl versions on my box (perl5.8 from ports,
perl5.10.1 from pkgsrc and the release candidate of perl5.12.0) - with
the same result.
Maybe someone could take a look?
If I can provide additional information, please let me know.
Best regards,
Jens
    
    
More information about the freebsd-questions
mailing list