Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70122 - mysql ebuild pkg_config, as of 4.0.22, incorrectly detects previously created mysql database
Summary: mysql ebuild pkg_config, as of 4.0.22, incorrectly detects previously created...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-04 19:40 UTC by Federico Galassi
Modified: 2004-12-23 02:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
a patch which fixes this bug (and does more: read my comment) (mysql-4.0.22.patch,2.80 KB, patch)
2004-11-04 19:49 UTC, Federico Galassi
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Galassi 2004-11-04 19:40:48 UTC
mysql-4.0.22.ebuild incorrectly assumes that mysql database is
/var/lib/mysql/mysql and ask to run mysql_install_db.
If user has changed DATADIR= in my.conf before launching pkg_config, that winds up as
beeing plain false.
Later in pkg_config code, the ebuild correctly queries my_print_defaults to get the real DATADIR location, so the solution is as simple as moving DATADIR-find code at the beginning and change the first check accordingly.


Reproducible: Always
Steps to Reproduce:
1. emerge mysql
2. change DATADIR in my.conf to something different than /var/lib/mysql
3. ebuild `equery which mysql` config

Actual Results:  
the script prompts user asking to create a new mysql databade

Expected Results:  
the script says that mysql is already there
Comment 1 Federico Galassi 2004-11-04 19:49:20 UTC
Created attachment 43318 [details, diff]
a patch which fixes this bug (and does more: read my comment)

This patch, against 4.0.22 ebuild, fixes the bug.
I added also another feature which i think it's useful:
config does ask if user wants to set up mysql root password and  then helps
him.
I think this is good because that's the n
Comment 2 Federico Galassi 2004-11-04 19:49:20 UTC
Created attachment 43318 [details, diff]
a patch which fixes this bug (and does more: read my comment)

This patch, against 4.0.22 ebuild, fixes the bug.
I added also another feature which i think it's useful:
config does ask if user wants to set up mysql root password and  then helps
him.
I think this is good because that's the nĀ°1 security flaw easily missed by
common users. Since this feature is questionable, the mantainer should give it
a look and decide. If he wants to keep the bugfix only, he can cut the code
which
is under the comment #setup root password.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-23 02:06:26 UTC
I've put in the part of your patch dealing with DATADIR.
However I will not include the password setting part.