Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 87982 - passwd segfaults when line lacks one or more colons
Summary: passwd segfaults when line lacks one or more colons
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: passwd
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-04-04 09:46 UTC by Lorens Kockum
Modified: 2007-04-18 16:52 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-03-25 11:54:33 UTC


Attachments (Terms of Use)

Description Lorens Kockum 2003-04-04 09:46:35 UTC
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 11:54:33 UTC
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 14:43:12 UTC
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.