Re: can't change password with passwd comand

2007-11-21 Thread Kafriki

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. 



Re: can't change password with passwd comand

2007-11-21 Thread Kafriki
ok here is a user with full details: (this is in plain text, hope it's more 
readable)


cat.cat:$2a$07$aYgatzjxAULHQmmZkjmvteGEaO8Ie8geMoUfhl7AAzKi.WeRhuoA6:10006:20::0:0:Pussy 
Cat:/smbhome/student_homedirs/cat.cat:/bin/ksh



- Original Message - 
From: Clint Pachl

To: Jumping Mouse
Cc: misc@openbsd.org
Sent: Tuesday, November 20, 2007 8:56 PM
Subject: Re: can't change password with passwd comand


Jumping Mouse wrote:

Hi Clint,  Yes I am the one.   as for changing the password this seems to
happen to any user except for the root acount, I am able to use  passwd to
change the root account password.  Here is line 24: (I removed the 
password

and real usernmame) username::1000:0::0:0:username:/home/username:/bin/ksh


I was going to say, don't remove the username or password because the
problem could be embedded in either one of those fields. Anyway, check
to make sure that there is no whitespace adjacent to any colons.

 I
don't know if this matters but there is no ptmp file in the /etc directory
(no was there before I followed your earlier instructions)


Doesn't matter. Just wanted to make sure it wasn't causing any problems
when running passwd, which uses that file name as it's temp file. 



Re: can't change password with passwd comand

2007-11-21 Thread Clint Pachl

Kafriki wrote:
ok here is a user with full details: (this is in plain text, hope it's 
more readable)


cat.cat:$2a$07$aYgatzjxAULHQmmZkjmvteGEaO8Ie8geMoUfhl7AAzKi.WeRhuoA6:10006:20::0:0:Pussy 
Cat:/smbhome/student_homedirs/cat.cat:/bin/ksh


Ok, so you're a cat lover.

Anyway, that dot in the username may be causing some problems. passwd(5) 
says:


The login name may be up to 31 characters long.  For compatibility with
legacy software, a login name should start with a letter and consist
solely of letters, numbers, dashes and underscores.  The login name must
never begin with a hyphen (`-'); also, it is strongly suggested that nei-
ther uppercase characters nor dots (`.') be part of the name, as this
tends to confuse mailers.  No field may contain a colon as this has been
used historically to separate the fields in the user database.

I successfully added the user cat.cat and changed the user's password 
with passwd(1) on my 4.1 system. I'm not sure what is going on in your 
system.


Try using vipw to replace the password with an * then try running 
passwd again.


Are you sure there isn't an empty line in master.passwd?

I appended an empty line to my master.passwd and ran passwd and I 
received the same exact error as you did. BTW, how many lines are in 
your master.passwd file (wc -l  /etc/master.passwd) and what is the line 
number with the error reported by passwd?


Because vipw is working for you, try removing the invalid line, then run 
passwd for another account. This should test whether your passwd program 
is working properly. It is weird that vipw works, but passwd complains.





- Original Message - From: Clint Pachl
To: Jumping Mouse
Cc: misc@openbsd.org
Sent: Tuesday, November 20, 2007 8:56 PM
Subject: Re: can't change password with passwd comand


Jumping Mouse wrote:
Hi Clint,  Yes I am the one.   as for changing the password this 
seems to
happen to any user except for the root acount, I am able to use  
passwd to
change the root account password.  Here is line 24: (I removed the 
password
and real usernmame) 
username::1000:0::0:0:username:/home/username:/bin/ksh


I was going to say, don't remove the username or password because the
problem could be embedded in either one of those fields. Anyway, check
to make sure that there is no whitespace adjacent to any colons.

 I
don't know if this matters but there is no ptmp file in the /etc 
directory

(no was there before I followed your earlier instructions)


Doesn't matter. Just wanted to make sure it wasn't causing any problems
when running passwd, which uses that file name as it's temp file.




Re: can't change password with passwd comand

2007-11-21 Thread Cristiano Deana
On Nov 21, 2007 10:48 AM, Kafriki [EMAIL PROTECTED] wrote:

 ok here is a user with full details: (this is in plain text, hope it's more
 readable)

 cat.cat:$2a$07$aYgatzjxAULHQmmZkjmvteGEaO8Ie8geMoUfhl7AAzKi.WeRhuoA6:10006:20::0:0:Pussy
 Cat:/smbhome/student_homedirs/cat.cat:/bin/ksh

Don't paste a user but line 24's user

-- 
Cris, member of G.U.F.I
Italian FreeBSD User Group
http://www.gufi.org/



Re: can't change password with passwd comand

2007-11-21 Thread Nick Holland
Cristiano Deana wrote:
 On Nov 21, 2007 10:48 AM, Kafriki [EMAIL PROTECTED] wrote:
 
 ok here is a user with full details: (this is in plain text, hope it's more
 readable)

 cat.cat:$2a$07$aYgatzjxAULHQmmZkjmvteGEaO8Ie8geMoUfhl7AAzKi.WeRhuoA6:10006:20::0:0:Pussy
 Cat:/smbhome/student_homedirs/cat.cat:/bin/ksh
 
 Don't paste a user but line 24's user
 

and 23 and 25...

Better yet, end the blooming guessing game, post the thing somewhere.
Yes, that means all your PWs are trash, but if you are inheriting a
machine, you need to change all the PWs anyway...and probably once
again once you have properly secured it.

Or manually edit down the file to the absolute minimum that demonstrates
the problem.

Or move the file to another OpenBSD machine (they are easy to build)
and verify that the problem is IN that file, and not a systemic problem,
which is not out of the question, considering the other apparent damage
to it.  Then do what we will do and chew through the file and figure
out why it isn't working.

Nick.



Re: can't change password with passwd comand

2007-11-21 Thread Jumping Mouse
Ok, Ok I get the point.   I agree that posting line 24 will not help, any user
except root gives the same issues.  And as a last and final attempt I will
check the end of the file for any spaces as Clint suggested.

finally:

What if I try a master.passwd file form a working machine of same Build.  If
that file does work then we can conclude it is systemic. I am off for
thanksgiving over here in the US.. so it may be a while before I respond with
my results.

Thanks everyone, so far.
  - Original Message -
  From: Nick Holland
  To: misc
  Sent: Wednesday, November 21, 2007 7:18 AM
  Subject: Re: can't change password with passwd comand


  Cristiano Deana wrote:
   On Nov 21, 2007 10:48 AM, Kafriki [EMAIL PROTECTED] wrote:
  
   ok here is a user with full details: (this is in plain text, hope it's
more
   readable)
  
  
cat.cat:$2a$07$aYgatzjxAULHQmmZkjmvteGEaO8Ie8geMoUfhl7AAzKi.WeRhuoA6:10006:20
::0:0:Pussy
   Cat:/smbhome/student_homedirs/cat.cat:/bin/ksh
  
   Don't paste a user but line 24's user
  

  and 23 and 25...

  Better yet, end the blooming guessing game, post the thing somewhere.
  Yes, that means all your PWs are trash, but if you are inheriting a
  machine, you need to change all the PWs anyway...and probably once
  again once you have properly secured it.

  Or manually edit down the file to the absolute minimum that demonstrates
  the problem.

  Or move the file to another OpenBSD machine (they are easy to build)
  and verify that the problem is IN that file, and not a systemic problem,
  which is not out of the question, considering the other apparent damage
  to it.  Then do what we will do and chew through the file and figure
  out why it isn't working.

  Nick.



Re: can't change password with passwd comand

2007-11-21 Thread Clint Pachl

Jumping Mouse wrote:

Ok, Ok I get the point.   I agree that posting line 24 will not help, any user
except root gives the same issues.  And as a last and final attempt I will
check the end of the file for any spaces as Clint suggested.
  


You mean you haven't check for empty lines and trailing and adjacent 
spaces yet?



finally:

What if I try a master.passwd file form a working machine of same Build.  If
that file does work then we can conclude it is systemic.


What are you saying?

If you try a master.passwd file from a working machine and it does work, 
then we can conclude your original master.passwd file was crap.


At this point, I would say end the troubleshooting on the crappy 
master.passwd file and do what Holland said. Extract a master.passwd 
file from a pristine etcXX.tgz and go from there. DO NOT use a 
master.passwd from another working machine. We don't need to introduce 
other variables.




Re: can't change password with passwd comand

2007-11-20 Thread Todd C. Miller
In message [EMAIL PROTECTED]
so spake Jumping Mouse (kafriki):

 When I try to change a user password I get an error.
 I do this:
 
 #  passwd  username
 enter a new password and  get: pwd_mkdb:  corrupted entrypwd_mkdb: at line
 #24pwd_mkdb: /etc/ptmp: Innapropriate file type or formatpasswd:
 etc/master.passwd unchanged
 
 how can I fix this?

This indicates that your /etc/master.passwd file has some errors
unrelated to your attempt to change the password.

You should run the vipw command as root to fix the problem on line
24.  It sounds like that line is missing at least one field.

 - todd



Re: can't change password with passwd comand

2007-11-20 Thread Jumping Mouse
Hi Clint and others,

I tried:

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

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

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



 Date: Mon, 19 Nov 2007 19:33:06 -0700 From: [EMAIL PROTECTED] To:
[EMAIL PROTECTED] CC: misc@openbsd.org Subject: Re: can't change password
with passwd comand  Jumping Mouse wrote:  When I try to change a user
password I get an error.  I do this:   # passwd username  enter a new
password and get: pwd_mkdb: corrupted entrypwd_mkdb: at line  #24pwd_mkdb:
/etc/ptmp: Innapropriate file type or formatpasswd:  etc/master.passwd
unchanged   how can I fix this?# cd /etc # cp -p spwd.db pwd.db
passwd /root/ # backup # rm spwd* pwd* passwd* ptmp # pwd_mkdb
/etc/master.passwd # passwd username # try again
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: can't change password with passwd comand

2007-11-20 Thread Clint Pachl

Jumping Mouse wrote:

Hi Clint and others,

I tried:

  

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



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

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


Does line #24 have a subtle error? Check the format against passwd(5).

BTW, are you the guy that inherited an OpenBSD system without a root 
account?




Re: can't change password with passwd comand

2007-11-20 Thread Jumping Mouse
Hi Clint,  Yes I am the one.   as for changing the password this seems to
happen to any user except for the root acount, I am able to use  passwd to
change the root account password.  Here is line 24: (I removed the password
and real usernmame) username::1000:0::0:0:username:/home/username:/bin/ksh I
don't know if this matters but there is no ptmp file in the /etc directory
(no was there before I followed your earlier instructions) Date: Tue, 20 Nov
2007 15:59:52 -0700 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC:
misc@openbsd.org 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 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   I have searched the
faqs but have not been able to find a good solution to  this issue. Does
anyone have any thoughts?Does line #24 have a subtle error? Check the
format against passwd(5).  BTW, are you the guy that inherited an OpenBSD
system without a root  account?
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: can't change password with passwd comand

2007-11-20 Thread Jumping Mouse
One more follow up:

I added a new user.
then tried to change the users password with the passwd command and I get the
same results:

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

 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; misc@openbsd.org
Subject: Re: can't change password with passwd comand Date: Wed, 21 Nov 2007
01:13:56 +0100  Hi Clint, Yes I am the one. as for changing the password
this seems to happen to any user except for the root acount, I am able to use
passwd to change the root account password. Here is line 24: (I removed the
password and real usernmame)
username::1000:0::0:0:username:/home/username:/bin/ksh I don't know if this
matters but there is no ptmp file in the /etc directory (no was there before
I followed your earlier instructions) Date: Tue, 20 Nov 2007 15:59:52 -0700
From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: misc@openbsd.org
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 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   I have
searched the faqs but have not been able to find a good solution to  this
issue. Does anyone have any thoughts?Does line #24 have a subtle
error? Check the format against passwd(5).  BTW, are you the guy that
inherited an OpenBSD system without a root  account?
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: can't change password with passwd comand

2007-11-20 Thread Clint Pachl

Jumping Mouse wrote:

One more follow up:

I added a new user.
then tried to change the users password with the passwd command and I get the
same results:

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


That's interesting. The line with the error moved from #24 to #25. Make 
sure there are no empty lines anywhere in the file (check the last line) 
and no trailing spaces after any entry.


Also, the formatting of your replies are really messed up and are 
difficult to read. Are you sending in plain text?




Re: can't change password with passwd comand

2007-11-20 Thread Clint Pachl

Jumping Mouse wrote:

Hi Clint,  Yes I am the one.   as for changing the password this seems to
happen to any user except for the root acount, I am able to use  passwd to
change the root account password.  Here is line 24: (I removed the password
and real usernmame) username::1000:0::0:0:username:/home/username:/bin/ksh


I was going to say, don't remove the username or password because the 
problem could be embedded in either one of those fields. Anyway, check 
to make sure that there is no whitespace adjacent to any colons.

 I
don't know if this matters but there is no ptmp file in the /etc directory
(no was there before I followed your earlier instructions)


Doesn't matter. Just wanted to make sure it wasn't causing any problems 
when running passwd, which uses that file name as it's temp file.




Re: can't change password with passwd comand

2007-11-20 Thread Nick Holland
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.



can't change password with passwd comand

2007-11-19 Thread Jumping Mouse
When I try to change a user password I get an error.
I do this:

#  passwd  username
enter a new password and  get: pwd_mkdb:  corrupted entrypwd_mkdb: at line
#24pwd_mkdb: /etc/ptmp: Innapropriate file type or formatpasswd:
etc/master.passwd unchanged

how can I fix this?
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



Re: can't change password with passwd comand

2007-11-19 Thread Clint Pachl

Jumping Mouse wrote:

When I try to change a user password I get an error.
I do this:

#  passwd  username
enter a new password and  get: pwd_mkdb:  corrupted entrypwd_mkdb: at line
#24pwd_mkdb: /etc/ptmp: Innapropriate file type or formatpasswd:
etc/master.passwd unchanged

how can I fix this?
  


# cd /etc
# cp -p spwd.db pwd.db passwd /root/  # backup
# rm spwd* pwd* passwd* ptmp
# pwd_mkdb /etc/master.passwd
# passwd username  # try again