Bug 244541 - mysql-server only removes mysql user but not group in %postuninstall
Summary: mysql-server only removes mysql user but not group in %postuninstall
Keywords:
Status: CLOSED DUPLICATE of bug 241912
Alias: None
Product: Fedora
Classification: Fedora
Component: mysql
Version: 6
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Tom Lane
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-06-17 00:11 UTC by Till Maas
Modified: 2013-07-03 03:13 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-06-17 02:58:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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 ***


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