Bug 244541 - mysql-server only removes mysql user but not group in %postuninstall
mysql-server only removes mysql user but not group in %postuninstall
Status: CLOSED DUPLICATE of bug 241912
Product: Fedora
Classification: Fedora
Component: mysql (Show other bugs)
6
All Linux
low Severity high
: ---
: ---
Assigned To: Tom Lane
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-16 20:11 EDT by Till Maas
Modified: 2013-07-02 23:13 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-16 22:58:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Till Maas 2007-06-16 20:11:33 EDT
Description of problem:

The %post removes the user mysql when the package is uninstalled:
postuninstall scriptlet (using /bin/sh):
[...]
if [ $1 = 0 ] ; then
        userdel mysql >/dev/null 2>&1 || :
fi

but at install time the group mysql is created, too:
preinstall scriptlet (using /bin/sh):
/usr/sbin/useradd -M -o -r -d /var/lib/mysql -s /bin/bash \
        -c "MySQL Server" -u 27 mysql > /dev/null 2>&1 || :

So when one removes mysql-server, the group mysql is left behind and the useradd
silently fails.


Version-Release number of selected component (if applicable):
5.0.27-1.fc6

How reproducible:
always

Steps to Reproduce:
1. install mysql-server
2. uninstall mysql-server
3. install mysql-server
  
Actual results:
the user mysql is not there.

Expected results:
the user mysql should be created at install time of mysql-server or the user
should be somehow warned, that there is a problem. (Other than "Using root
instead of mysql, see additionial info)

Additional info:

When I installed mysql-server on CentOS 5 after removing it, the following
warning appeared:

  Installing: mysql-server                 ######################## 
[3/4]warning: user mysql does not exist - using root

So maybe this is also a security issue, I did not investigate further due to a
lack of time. In addition, this seems to be a problem in RHEL, too.
Comment 1 Till Maas 2007-06-16 20:12:40 EDT
I mean %postuninstall instead of %post in my first comment. Sorry, it is late
here  :-/
Comment 2 Tom Lane 2007-06-16 22:58:50 EDT

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

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