Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Nov 1996 11:35:57 -0800 (PST)
From:      Chris Timmons <skynyrd@tahoma.cwu.edu>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        Bill Paul <wpaul@skynet.ctr.columbia.edu>, bugs@freebsd.org
Subject:   Re: bin/1947: Something is really hosed with the passwd command, or something 
Message-ID:  <Pine.OSF.3.95.961103111532.227B-100000@tahoma.cwu.edu>
In-Reply-To: <5879.847024521@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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 <stdio.h>
	#include <unistd.h>

	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
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.95.961103111532.227B-100000>