mysql: Properly set the path to .my.conf when vservers are used.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 1 Jan 2009 18:56:12 +0000 (19:56 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 1 Jan 2009 18:59:00 +0000 (19:59 +0100)
This fixes the case when the user option and the vsname option are both
used.

handlers/mysql.in

index d22ef26c99d4cd926bffd3c7f32297664f08702f..3a908f68ef669b62e6c0cb3d63eeb230a5b86199 100644 (file)
@@ -161,7 +161,11 @@ else
        
        debug "User home set to: $userhome"
        [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
-       defaultsfile="--defaults-extra-file=$userhome/.my.cnf"
+        if [ $usevserver = yes ]; then
+            defaultsfile="--defaults-extra-file=$vuserhome/.my.cnf"
+        else
+            defaultsfile="--defaults-extra-file=$userhome/.my.cnf"
+        fi
        debug "using $defaultsfile"
 fi