Bug 178404 - userdel/useradd gives segmentaion fault when /etc/gshadow is screwed
userdel/useradd gives segmentaion fault when /etc/gshadow is screwed
Status: CLOSED DUPLICATE of bug 125510
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: shadow-utils (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2006-01-20 03:01 EST by Rainer Traut
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-01-23 06:41:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 04:08 EST, Rainer Traut
no flags Details

  None (edit)
Description Rainer Traut 2006-01-20 03:01:34 EST
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):

How reproducible:

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

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
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 03:04:54 EST
If you like I can attach the corrupt gshadow.
Comment 2 Peter Vrabec 2006-01-20 04:00:02 EST
Fine, could u attach your gshadow, please.
Comment 3 Rainer Traut 2006-01-20 04:08:41 EST
Created attachment 123469 [details]
gshadow file that caused it
Comment 4 Peter Vrabec 2006-01-23 06:41:29 EST
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.