From owner-freebsd-bugs Sun Nov 3 11:45:37 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA17495 for bugs-outgoing; Sun, 3 Nov 1996 11:45:37 -0800 (PST) Received: from tahoma.cwu.edu (root@tahoma.cwu.edu [198.104.65.220]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA17488 for ; Sun, 3 Nov 1996 11:45:29 -0800 (PST) Received: by tahoma.cwu.edu; id AA01216; Sun, 3 Nov 1996 11:35:58 -0800 Date: Sun, 3 Nov 1996 11:35:57 -0800 (PST) From: Chris Timmons To: "Jordan K. Hubbard" Cc: Bill Paul , bugs@freebsd.org Subject: Re: bin/1947: Something is really hosed with the passwd command, or something In-Reply-To: <5879.847024521@time.cdrom.com> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Well, please don't think I'm a whacko, but what does this little program report while you are having the trouble? Are you still jkh as far as getlogin() is concerned? #include #include main() { printf("%s\n", getlogin()); } On 2.1.x (including 2.1-S built a couple weeks before 2.1.5) I have seen at least the passwd scenario where I get the 'permission denied' message trying to change my own password. We have a machine with maybe 10 people logged in (initially via XDM) running fvwm-1.24. Xterms launched on the local machine from fvwm display this odd behavior: Somewhere, setlogin() is called incorrectly, or the value held in the kernel (or wherever that is kept) gets corrupted, so that id(1) reports the correct uid, but getlogin() returns a DIFFERENT username. One that's not even close, the same one every time, and THAT user gets MY username when they call getlogin(). This plays havoc with talk, anything that uses getlogin(). I've had the problem for a long time and see it daily, yet the couple of times I tried to run it down I didn't get very far (and besides I felt like I was crazy because noone else notices this.) I found some info a great while ago in the -hackers archive about similar problems with getlogin(), but the worst of it seems to be fixed. Although we have this problem daily, I could see no obvious cause for it in login.c or anywhere else - my thought was that xterm and fvwm might be involved; haven't glimpsed and poked around in xf86 yet to see. -Chris On Sun, 3 Nov 1996, Jordan K. Hubbard wrote: > > If you look in local_passwd.c (grep for EACCES -- this is a bit of a > > gotcha: the 'Permission denied' message is printed by the err() function > > rather than being in the code), you'll see where this error message > > comes from. I think the problem may be that you su'ed to another user. > > Well, actually not. I was myself, but I've since seen this problem > happen 3 times more in -current and am now totally mystified - it's > not a passwd problem, it's something a lot weirder. > > For lack of a better description - my userid just goes away. Ha ha, > no, please, put away the net - let me explain! I'll be logged in as > myself, su for something or another, then exit the su shell and come > back (heh) to myself. Tada, I'm now unable to write files in my own > home directory or do anything as myself - any file I attempt to open, > /usr/bin/passwd included on that occasion, is a "Permission denied" > and the *only* thing which fixes it is to chown the files I own to > myself again (even though an ls -l showed them to be owned by me > already). Doesn't matter that I've just done this a few minutes > previously, during the previous event, I have to do it again. Logging > out and back in again does not have any effect. > > Investigating - this one is annoying and strange. > > Jordan >