From owner-freebsd-commit Tue Oct 31 16:05:40 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA03197 for freebsd-commit-outgoing; Tue, 31 Oct 1995 16:05:40 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA03183 for cvs-all-outgoing; Tue, 31 Oct 1995 16:05:33 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id QAA03173 for cvs-CVSROOT-outgoing; Tue, 31 Oct 1995 16:05:31 -0800 Received: from sovcom.kiae.su (sovcom.kiae.su [144.206.136.1]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id QAA03164 ; Tue, 31 Oct 1995 16:05:23 -0800 Received: by sovcom.kiae.su id AA00713 (5.65.kiae-1 ); Wed, 1 Nov 1995 03:00:17 +0300 Received: by sovcom.KIAE.su (UUMAIL/2.0); Wed, 1 Nov 95 03:00:17 +0300 Received: (from ache@localhost) by ache.dialup.demos.ru (8.6.12/8.6.12) id CAA01922; Wed, 1 Nov 1995 02:59:39 +0300 To: CVS-commiters@freefall.freebsd.org, cvs-CVSROOT@freefall.freebsd.org, Peter Wemm References: <199510312317.PAA00986@freefall.freebsd.org> In-Reply-To: ; from =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= at Wed, 1 Nov 1995 02:39:07 +0300 (MSK) Message-Id: Organization: Olahm Ha-Yetzirah Date: Wed, 1 Nov 1995 02:59:39 +0300 (MSK) X-Mailer: Mail/@ [v2.40 FreeBSD] From: =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (aka Andrey A. Chernov, Black Mage) X-Class: Fast Subject: Re: cvs commit: CVSROOT log_accum.pl Lines: 43 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Length: 1427 Sender: owner-commit@FreeBSD.org Precedence: bulk In message =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= writes: >In message <199510312317.PAA00986@freefall.freebsd.org> Peter Wemm > writes: >>peter 95/10/31 15:17:14 (peter/633/peter) >> Modified: . log_accum.pl >> Log: >> For the moment, prefer the getpwuid($<) value over getlogin.. >> Remove debugging output again.. (which proved that getlogin returns the >> wrong value sometimes..) >getlogin depends on internal variable _logname_valid which is set >after first sucessful getlogin call, then getlogin simple return >its static data and even not issue syscall!!! >How perl calls C-functions, it is the question... >Maybe it call each C-function in the fork? I.e. _longname_valid >always 0 for getlogin? Then it is perl bug, it seems that >it change uids on the fly, then call getlogin for each of them. You can to localize perl miss with simple script like: #!/usr/bin/perl while(1) { print getlogin(); print " "; print ((getpwuid($<))[0]); print "\n"; } If it works right, try to reproduce sequence from CVS .pl exactly (in the infinite loop). -- Andrey A. Chernov : And I rest so composedly, /Now, in my bed, ache@astral.msk.su : That any beholder /Might fancy me dead - http://dt.demos.su/~ache : Might start at beholding me, /Thinking me dead. RELCOM Team,FreeBSD Team : E.A.Poe From "For Annie" 1849