This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 87982 - passwd segfaults when line lacks one or more colons
passwd segfaults when line lacks one or more colons
Status: CLOSED WORKSFORME
Product: Red Hat Linux
Classification: Retired
Component: passwd (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Tomas Mraz
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2003-04-04 04:46 EST by Lorens Kockum
Modified: 2007-04-18 12:52 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-25 06:54:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Lorens Kockum 2003-04-04 04:46:35 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623
Debian/1.0.0-0.woody.1

Description of problem:

passwd chokes and segfaults on a user where a field is lacking in /etc/passwd.

I discovered this through a long and complicated process involving sed, regexps,
ftp logins, and renamed homedirs, but I've reproduced it very simply as in
"Steps to reproduce".

Additionally I would have thought vipw would have caught that, but that was an
impression I retained from OpenBSD where vipw does a consistency check on the
file before install.

I don't see how this could be a security problem (adding a colon too many does
not seem to have any ill effects, except the ones expected from field
displacement, otherwise one could have looked around a bit) but I don't like the
very idea of /usr/bin/passwd segfaulting.

Not reproducible on Debian 3.0.


Version-Release number of selected component (if applicable):
passwd-0.67-3

How reproducible:
Always

Steps to Reproduce:
Edit /etc/passwd (I used vipw).

Remove one of the two colons around an empty real name field of a valid existing
user, so one colon and one field less in the file.

Exit vipw, not modifying shadow.

Execute `passwd user` in order to set a password, where user is the one that has
one colon less (other users are unaffected).



Actual Results:  # passwd squid
Changing password for user squid.
Segmentation fault


Expected Results:  passwd should have output an error. I see no appropriate
error messages in the binary.

Additional info:


The affected user cannot login, at least not using vsFTPd. No special error
message in the logs.
Comment 1 Tomas Mraz 2005-03-25 06:54:33 EST
Can't reproduce on FC3 - passwd now reports Authentication token manipulation error

If you still can reproduce the segfault on a current Fedora/RHEL distribution,
please reopen.
Comment 2 Lorens Kockum 2005-03-25 09:43:12 EST
I confirm that I cannot reproduce on FC3.

Note You need to log in before you can comment on or make changes to this bug.