aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2005-12-27 17:36:32 +0000
committerMicah Anderson <micah@riseup.net>2005-12-27 17:36:32 +0000
commit21b3955283639c57454541ffe3702c775da3004c (patch)
tree5ca84026bebc61ea88342024c05ca6d0d548f0ef
parentf46646600fb4f89235ab3cf1e096885f1ed59666 (diff)
downloadbackupninja-21b3955283639c57454541ffe3702c775da3004c.tar.gz
backupninja-21b3955283639c57454541ffe3702c775da3004c.tar.bz2
r214@um: micah | 2005-12-27 09:35:03 -0500
Added vserver functionality to the user authentication method
-rw-r--r--handlers/mysql21
1 files changed, 19 insertions, 2 deletions
diff --git a/handlers/mysql b/handlers/mysql
index 49f80a8..9cf3c3d 100644
--- a/handlers/mysql
+++ b/handlers/mysql
@@ -52,8 +52,25 @@ if [ "$user" == "" ]; then
user=root;
else
userset=true;
- userhome=`getent passwd "$user" | awk -F: '{print $6}'`
- [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
+ if [ $usevserver ]
+ then
+ userhome=`$VSERVER $vsname exec getent passwd "$user" | awk -F: '{print $6}'`
+ if [ $? -eq 2 ]
+ then
+ fatal "User $user not found in /etc/passwd"
+ fi
+ userhome="$VROOTDIR/$vsname$userhome"
+ info "User home set to: $userhome"
+ [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
+ else
+ userhome=`getent passwd "$user" | awk -F: '{print $6}'`
+ if [ $? -eq 2 ]
+ then
+ fatal "User $user not found in /etc/passwd"
+ fi
+ info "User home set to: $userhome"
+ [ -f $userhome/.my.cnf ] || fatal "Can't find config file in $userhome/.my.cnf"
+ fi
fi
## Prepare ignore part of the command