Bug 244541

Summary: mysql-server only removes mysql user but not group in %postuninstall
Product: [Fedora] Fedora Reporter: Till Maas <opensource>
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: low    
Version: 6CC: byte, hhorak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-17 02:58:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Till Maas 2007-06-17 00:11:33 UTC
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-17 00:12:40 UTC
I mean %postuninstall instead of %post in my first comment. Sorry, it is late
here  :-/

Comment 2 Tom Lane 2007-06-17 02:58:50 UTC

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