Bug 178404 - userdel/useradd gives segmentaion fault when /etc/gshadow is screwed
Summary: userdel/useradd gives segmentaion fault when /etc/gshadow is screwed
Status: CLOSED DUPLICATE of bug 125510
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: shadow-utils   
(Show other bugs)
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-01-20 08:01 UTC by Rainer Traut
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-01-23 11:41:29 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
gshadow file that caused it (74.13 KB, text/plain)
2006-01-20 09:08 UTC, Rainer Traut
no flags Details

Description Rainer Traut 2006-01-20 08:01:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5

Description of problem:
I suddenly experienced segmentaion fault when I wanted to add and del some users.
After strace and help from the nahant ML I found out that /etc/gshadow was in a bad shape.
All tools seem to segfault when accessing it, although they should give better output of what's going on and not crash (as they important admin tools).
It's not too easy to discover the cause of the problem if you are unfamiliar with strace e.g.

Version-Release number of selected component (if applicable):
shadow-utils-4.0.3-58.RHEL4

How reproducible:
Always

Steps to Reproduce:
1. [root@jupiter etc]# useradd xyz
2. Segmentation fault
3.
  

Actual Results:  User was added although the error occured.


Expected Results:  No error.

Additional info:

strace of the useradd (last lines):

open("/etc/gshadow", O_RDWR|O_LARGEFILE) = 9
fstat64(9, {st_mode=S_IFREG|0400, st_size=75908, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb7d78000
read(9, "root:::root\nbin:::root,bin,daemo"..., 4096) = 4096
read(9, ",ns,,,ns,,s,,,,,s,,,,,ins,ns,s,,"..., 4096) = 4096
read(9, "s,,ns,s,,,,s,,,,s,,,,,,ns,s,,s,,"..., 4096) = 4096
read(9, ",s,,,,,ins,ns,,ns,s,,s,,,,ns,,s,"..., 4096) = 4096
read(9, ",,,,,s,,s,,,ins,ns,s,,ns,s,,s,,,"..., 4096) = 4096
read(9, "s,,,,,,,ins,s,,ns,,s,,,s,,,,,ns,"..., 4096) = 4096
read(9, ",s,s,,,,,ins,ns,s,,s,,,,ns,s,,s,"..., 4096) = 4096
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 5852 detached

Comment 1 Rainer Traut 2006-01-20 08:04:54 UTC
If you like I can attach the corrupt gshadow.

Comment 2 Peter Vrabec 2006-01-20 09:00:02 UTC
Fine, could u attach your gshadow, please.

Comment 3 Rainer Traut 2006-01-20 09:08:41 UTC
Created attachment 123469 [details]
gshadow file that caused it

Comment 4 Peter Vrabec 2006-01-23 11:41:29 UTC
This bug is fixed in shadow-utils-4.0.3-60.RHEL4, which is included in update #3.

*** This bug has been marked as a duplicate of 125510 ***


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