Hi Nick,
Thanks for your points: sorry about the formating, I am sending this in plain text , let me know if this is better.

I have looked over the master.passwd file and compaired with another machines working master.passwd and everything seems ok.

you wrote:

" You can add and delete users all you want, there's something wrong with
the master.passwd file.  When you call up vipw or passwd, it makes a copy
of that file to /etc/ptmp, you edit that file, then it does a sanity check
and if it passes the sanity check, it rolls that file back to
master.passwd, and makes the rest of the files (not necessarily in that
order).  Yours doesn't pass the sanity check."

The strange thing is, is that if I use vipw and make changes it accepts the changes, but it does not except changes when I use passwd. If somthing is wrong with master.passwd file, wouldn't vipw also not work?

I will try your suggestion about copying a fresh master.passwd file to /etc and starting from scratch.. see if that works.. I hope so (-:

Thanks for all your help!




----- Original Message ----- From: Nick Holland
To: misc@openbsd.org
Sent: Tuesday, November 20, 2007 10:29 PM
Subject: Re: can't change password with passwd comand


Jumping Mouse wrote:
Hi Clint and others,

I tried:

# rm spwd* pwd* passwd* ptmp> # pwd_mkdb /etc/master.passwd

pointless.

then
#passwd username

but I am still getting: (for all users)

pwd_mkdb: corrupted entrypwd_mkdb: at line #24pwd_mkdb: /etc/ptmp:
Inappropriate file type or formatpasswd: /etc/master.passwd: unchanged

right.  If the file is corrupted, the file is corrupted, it isn't going
to spend a lot of time trying to push a change in and maybe make it
worse.  It is curious that it does let you change root's PW, but that's
nice, it does let you get back in and fix the rest.

I have searched the faqs but have not been able to find a good solution to
this issue.  Does anyone have any thoughts?

EXACTLY what it says.  Something around line 24 is wrong.

A FEW ideas:
* Line break at col 80 that you are assuming is a wrap, but it isn't.
* Trailing spaces.
* Blank lines (including an extra newline at end-of-file)

Those are some of the errors I've made.  I've probably repressed the
really funny ones.  You are free to make your own. :)

You can add and delete users all you want, there's something wrong with
the master.passwd file.  When you call up vipw or passwd, it makes a copy
of that file to /etc/ptmp, you edit that file, then it does a sanity check
and if it passes the sanity check, it rolls that file back to
master.passwd, and makes the rest of the files (not necessarily in that
order).  Yours doesn't pass the sanity check.

Before you run vipw/passwd/whatever there is no /etc/ptmp file unless
someone killed an edit inappropriately.  If that's the case, it doesn't
let you edit the file in the first place.

Your file is corrupted.  You need to fix it.  Don't edit the file
and then expect us to spot the error unless it is really blatant, and
at this point, don't bother trying to convey much info at all over that
mailer you are using. :)

Worst case, assuming you are the only one (or one of few) on the system,
grab the /etc/master.passwd from the etcXX.tgz file of the appropriate
version of OpenBSD you are running, stick it in /etc, run vipw, make a
trivial change (or run mkwhateveritis), exit, change root's PW, and
re-populate the file one user at a time.

You already know unpleasant things happened to your passwd file.
You have a regular "user" at line 24...that's been a while since a
regular user popped up that early in the file.  You probably have got
lots of problems there.  Fortunately, it is pretty easy to rebuild.
Just save a copy of your current version, and after the dust settles,
copy over the individual users you need (and watch for wraps!).
And ONLY those users...

Nick.

Reply via email to