On Tuesday 18 September 2007, Albert Hopkins wrote:

> open("/etc/passwd", O_RDONLY)           = 3
> open("/etc/shadow", O_RDONLY)           = 3
> chage: can't open password file

Since the opens succeed, this must be some other kind of error.
Looking at the sources could possibily help here.

In chage.c, the message is printed if the function pw_open() returns a 
nonzero value.
Following che chain of function calls, we arrive at commonio_open() 
(inside commonio.c). That function can fail for various reasons. The 
file is opened correctly, so the error has to be searched after the 
fopen(). Excluding failure of the various memory-allocation functions, 
the other likely possibilities involve some failure during parsing 
(which here is done manually, not with the usual getpwent() and co.). 
Double check your /etc/passwd and /etc/shadow for syntactical 
correctness. I'd ask you to remove sensible information and post them 
here, but the cleanup could possibly also remove the information that 
chage's parser doesn't like, so check them on your own.
--
[EMAIL PROTECTED] mailing list

Reply via email to