Bug 462054 - Useradd errors reported when installing packages
Useradd errors reported when installing packages
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: shadow-utils (Show other bugs)
9
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-09-12 04:41 EDT by Simon Andrews
Modified: 2012-09-06 16:29 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-16 04:38:21 EDT
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 Simon Andrews 2008-09-12 04:41:38 EDT
Description of problem:
After installing the latest shadow-utils I'm seeing errors like this in /var/log/secure

Sep 11 14:58:05 bilin1 useradd[9216]: failed adding user `sshd', data deleted
Sep 12 05:19:39 bilin1 useradd[13233]: failed adding user `backuppc', data deleted

I can find no trace of similar messages coming up before.  In the case of the backuppc error, no such user exists on the system so it looks like the command has completely failed.

Version-Release number of selected component (if applicable):
shadow-utils-4.1.1-4.fc9.x86_64

How reproducible:
Happened consistently across 6 different servers.

Steps to Reproduce:
1.Install latest shadow utils
2.Use yum to upgrade other packages (openssh-server?)

  
Actual results:
Errors appear in /var/log/secure.  The new user is not created.

Additional info
This happens on both i386 and x86_64.
Comment 1 Simon Andrews 2008-09-15 09:23:43 EDT
Having looked at this a bit more, it seems that this error appears in the secure log when rpm tries to install a user which already exists.  Trying the same command from the spec file on the command line gets me:

useradd: user backuppc exists

..which makes sense, but /var/log/secure still says:

useradd[25979]: failed adding user `backuppc', data deleted

I'm not sure what the 'data deleted' means, or if this is a new message, but it's being reported in logwatch reports when I don't remember seeing it before.

The original report is incorrect in that it says that the user is not created.  It seems that this actually happens when the useradd fails because the user already exists.
Comment 2 Peter Vrabec 2008-09-16 04:38:21 EDT
# useradd foo
# useradd foo
useradd: user foo exists
# tail /var/log/secure
....
Sep 16 10:18:41 xen80 useradd[2023]: new group: name=foo, GID=501
Sep 16 10:18:41 xen80 useradd[2023]: new user: name=foo, UID=501, GID=501, home=/home/foo, shell=/bin/bash
Sep 16 10:18:46 xen80 useradd[2029]: failed adding user `foo', data deleted
# rpm -q shadow-utils
shadow-utils-4.1.1-4.fc9.i386

Simon, it seems this behaviour is common for shadow-utils for longer time. (at least shadow-utils-4.0.3). When something goes wrong useradd always just generate this syslog message. Note, it prints "useradd: user foo exists" on command line.

If you think this should be changed, please start some discussion on fedora-devel or shadow-utils upstream. It should be some consensus about it before we could start changing it.
Comment 3 Cristian G. 2012-09-06 16:29:10 EDT
i fix this error doing this:

1- mv /sbin/useradd /sbin/useradd.bin
2- create an script called '/sbin/useradd' whith the next code:

#!/bin/bash

/sbin/useradd.bin $@

exit 0

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