Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Aug 1998 13:22:58 -0700 (MST)
From:      James Snow <sno@teardrop.org>
To:        djv@bedford.net
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Weird /home problem
Message-ID:  <Pine.BSF.3.96.980805125333.29493F-100000@silver.teardrop.org>
In-Reply-To: <199808051832.OAA21740@lucy.bedford.net>

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


On Wed, 5 Aug 1998 djv@bedford.net wrote:

> I have the feeling that the login database may be unsynchronized,
> -- reason: you've been busy there, possibly not using vipw, etc etc.
> That /etc/passwd, /etc/master.passwd, /etc/spwd.db and /etc/pwd.db are 
> not in agreement is my hypothesis.

This was mine and several others' first thought, but I have only used vipw
in editing the password database. (No addusers, nothing.) I've also
duplicated this on a local FreeBSD 3.0 machine. Here is exactly what I
did. I would be really interested to know if this did not produce the same
problem for other people.

Created a new group entry, buggy - /etc/group: (dork being the user to be
added)

buggy:*:5000:dork

Run vipw and put the enter the following line:

dork::1005:5000:Dork:/home/buggy/dork:/usr/local/bin/tcsh

Verify that /home is 755 - chmod 755 /home
Make the sub of home - mkdir /home/buggy
Set its perms - chown root:buggy /home/buggy ; chmod 750 /home/buggy
Then the user - 
mkdir /home/buggy/dork ; chown dork:buggy /home/buggy/dork 
chmod 700 /home/buggy/dork

Then when he logs in, he gets:

No home directory.
Logging in with home = "/".

and the logs get:

login: _secure_path: cannot stat /home/buggy/dork/.login_conf: Permission
denied

> Use vipw to edit master.passwd, make some inconsequential change,
> (delete some character and restore it), and exit vipw. I think
> that you may have changed home directories in /etc/passwd, not
> using vipw. Verify that the homedirs are correctly set when viewed
> with vipw. 

Tried this and it had no effect.

> The error message you're getting is consistent with logging
> in to a non-existent directory.

But why does login behave differently when called at actual login and when
called from the command line immediately after the botched login? That is,
it doesn't find $home after logging in, but subsequently typing 'login'
and logging in again works perfectly. 

My thoughts on that would be that a user-id or group-id is not set when
the user is first telnetting it from the outside world, but that after his
botched login it is set, and the subsequent call to login pulls it from
his environment settings or something along those lines. 

I've not extensively examined the source for login, so I apologize if any
of that was infeasible, impossible, impractical, etc.

> Before doing anything, try using 'finger someuser' to see what home
> directory finger reports. Manually compare /etc/passwd and /etc/master.passwd.

This reports correctly for all users.

> Note that /etc/passwd is a _constructed_ file -- it is the sanitized
> result of using vipw on /etc/master.passwd  pwd.db and spwd.db are
> also _constructed_.

Does running vipw perhaps not reconstruct these entirely from scratch? Can
I make it do so?

> After all that hot air, I sure hope that's the problem.

I wish it was. Thanks very much for your help though.

> I cannot account for that. I can't duplicate your problem, even with
> these new ownerships and permissions.  

If the steps at the top of this don't do it I'll be quite suprised.

> Hmm, you're not running NIS, are you?

Nope.


Thanks again,
James Snow


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980805125333.29493F-100000>