Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 278633 - dev-db/mysql: offer automated config via password in /root/.my.cnf
Summary: dev-db/mysql: offer automated config via password in /root/.my.cnf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-22 06:51 UTC by James Pic
Modified: 2010-03-24 03:46 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Pic 2009-07-22 06:51:12 UTC
emerge --config mysql must be attended by the sysadmin.

mysql.eclass function mysql_pkg_config() should try to get the password from the config file.

Example:
    local config="${HOME}/.my.cnf"

    if [[ -f $config ]] && [[ `grep -q password $config` ]]; then
        pwd1=`grep password $config | sed -e "s/password=//"`
    else
        einfo "Insert a password for the mysql 'root' user"
        ewarn "Avoid [\"'\\_%] characters in the password"
        read -rsp "    >" pwd1 ; echo
    
        einfo "Retype the password"
        read -rsp "    >" pwd2 ; echo
    
        if [[ "x$pwd1" != "x$pwd2" ]] ; then
            die "Passwords are not the same"
        fi  
    fi

Thanks for your time to integrate such a trivial and useful feature.

Reproducible: Always

Steps to Reproduce:
1. emerge --config mysql
2.
3.

Actual Results:  
Admin must attend to paste the passwords from /root/.my.cnf.

Expected Results:  
Admin can do something else than copy/paste.
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-03-24 03:46:01 UTC
In eclass now.