From owner-freebsd-questions@FreeBSD.ORG Thu Jul 15 12:15:47 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 3FCCD1065675 for ; Thu, 15 Jul 2010 12:15:47 +0000 (UTC) (envelope-from rehsack@googlemail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id CF5458FC12 for ; Thu, 15 Jul 2010 12:15:46 +0000 (UTC) Received: by wyf22 with SMTP id 22so798283wyf.13 for ; Thu, 15 Jul 2010 05:15:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=MxEFD5yYZ8Yb8wDCEPggWCuCt80qEMLLyVDlUhzUpyI=; b=MgrAZhcD4fsb/93FQx+ERZYCmVfCpqtjhQNuLg2TJoMaFt31xYPe/lGgpS4GwxAZ5+ a4fKSz6IQNAPGPu+clWnmv4uNydOdh7ro3fiPv/zCt5oiAYOsRewUdnMUVv1xteQlei4 UqahybDyGaOVZyoxqceEaBOwTNTZn1R+fEgIA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=itLntFhGU/bAbtLOYncMrDbDrnJYwVMuBkKhCFNAqsM8iZGgHWTZagfoQkZo+MUmCE JxmnGmRjrno41s02p/GX4IBUAWYsDxaA+0pr2yYbnZSCBVs3KydsPODrrP37g33ghvxq aVU0v3mE6g/9SlAsyC1zAqkc8bi4lwQeY9d68= MIME-Version: 1.0 Received: by 10.216.132.86 with SMTP id n64mr8454637wei.11.1279196144848; Thu, 15 Jul 2010 05:15:44 -0700 (PDT) Received: by 10.216.89.66 with HTTP; Thu, 15 Jul 2010 05:15:44 -0700 (PDT) Date: Thu, 15 Jul 2010 14:15:44 +0200 Message-ID: From: Jens Rehsack To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: 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: Thu, 15 Jul 2010 12:15:47 -0000 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