From owner-freebsd-commit Tue Oct 31 13:57:43 1995 Return-Path: owner-commit Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA27089 for freebsd-commit-outgoing; Tue, 31 Oct 1995 13:57:43 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA27073 for cvs-all-outgoing; Tue, 31 Oct 1995 13:57:38 -0800 Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id NAA27060 for cvs-sys-outgoing; Tue, 31 Oct 1995 13:57:34 -0800 Received: from jhome.DIALix.COM (root@jhome.DIALix.COM [192.203.228.69]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id NAA27041 ; Tue, 31 Oct 1995 13:57:11 -0800 Received: (from peter@localhost) by jhome.DIALix.COM (8.6.12/8.6.9) id FAA28492; Wed, 1 Nov 1995 05:56:58 +0800 Date: Wed, 1 Nov 1995 05:56:58 +0800 (WST) From: Peter Wemm To: CVS-commiters@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Subject: Re: cvs commit: src/sys/i386/isa isa.c In-Reply-To: <199510312104.NAA23398@freefall.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-commit@FreeBSD.org Precedence: bulk On Tue, 31 Oct 1995, Peter Wemm wrote: > tweten 95/10/31 13:03:59 (tweten/633/peter) OK.. Anybody got any idea why "getlogin" is failing on the tail end of a rsh? sub build_header { local($version) = @_; local($header); delete $ENV{'TZ'}; local($sec,$min,$hour,$mday,$mon,$year) = localtime(time); $version = ''; $login = getlogin || (getpwuid($<))[0] || die("Unknown user $<.\n"); ^^^^^^^^ $header = sprintf("%-8s %s %02d/%02d/%02d %02d:%02d:%02d (%s/%d/%s)", $login, $version, $year%100, $mon+1, $mday, $hour, $min, $sec, getlogin, $<, (getpwuid($<))[0]); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } Since freefall isn't sharing uid's, I'd like to remove the getlogin as a defensive measure. I still want to know why it's possible for me to run a non-setuid program on the end of a rsh, and that non-setuid program somehow gets a different name from it's getlogin() system call. There has got to be a kernel bug there somewhere.. (I've seen similar things happen with XFree86's xdm). -Peter