I have just discovered a very unusual thing. Trying to change any password on my gentoo laptop is now not possible using the standard passwd utility. It seems that every time I try to type this on the command line even as root it quits with an error that doesn't tell what the problem is.
Code:
# passwd
passwd: Critical error - immediate abort
The permissions on the passwd and shadow files is as follows
Code:
# ll /etc/passwd /etc/shadow
-rw-r--r-- 1 root root 2219 Feb 11 21:53 /etc/passwd
-rw------- 1 root root 1000 Feb 11 21:56 /etc/shadow
An strace seems to indicate that the last thing that the passwd utility does is to open /etc/shadow and then do some seeking and then close it and write the error message.
I have found references to this all over the internet, mainly old redhat. The only solution I could see was to make sure the source was compiled with the right dict reference or something but I can't see how this could suddenly be a problem.
The shadow file seems to be in order having checked it out, as does the passwd file. Both have what look like fully functional lines for the root user and my regular user.
The last thing I did before trying to change the passwd of a new test user was to run unshadow from jtr. I guess this could have corrupted the original files but they look perfectly intact so my guess is there may be some file lock on /etc/shadow so I did an lsof /etc/shadow but this revealed nothing. I can still add and delete users using useradd and userdel but I can't set their passwords.
Any ideas how to check out if there is a file lock or how to fix this problem?