Gentoo Archives: gentoo-user

From: Etaoin Shrdlu <shrdlu@×××××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] chage can't open /etc/passwd
Date: Tue, 18 Sep 2007 09:08:04
Message-Id: 200709181105.24193.shrdlu@unlimitedmail.org
In Reply to: Re: [gentoo-user] chage can't open /etc/passwd by Albert Hopkins
1 On Tuesday 18 September 2007, Albert Hopkins wrote:
2
3 > open("/etc/passwd", O_RDONLY)           = 3
4 > open("/etc/shadow", O_RDONLY) = 3
5 > chage: can't open password file
6
7 Since the opens succeed, this must be some other kind of error.
8 Looking at the sources could possibily help here.
9
10 In chage.c, the message is printed if the function pw_open() returns a
11 nonzero value.
12 Following che chain of function calls, we arrive at commonio_open()
13 (inside commonio.c). That function can fail for various reasons. The
14 file is opened correctly, so the error has to be searched after the
15 fopen(). Excluding failure of the various memory-allocation functions,
16 the other likely possibilities involve some failure during parsing
17 (which here is done manually, not with the usual getpwent() and co.).
18 Double check your /etc/passwd and /etc/shadow for syntactical
19 correctness. I'd ask you to remove sensible information and post them
20 here, but the cleanup could possibly also remove the information that
21 chage's parser doesn't like, so check them on your own.
22 --
23 gentoo-user@g.o mailing list