Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Jul 2010 14:15:44 +0200
From:      Jens Rehsack <rehsack@googlemail.com>
To:        freebsd-questions@freebsd.org
Subject:   getpwent bug?
Message-ID:  <AANLkTin5RGYfu_Xt5HWxKFO8GMTOi3YWQ8dyr95ZDW-Y@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTin5RGYfu_Xt5HWxKFO8GMTOi3YWQ8dyr95ZDW-Y>