Index: /locker/sql/bin/get-password
===================================================================
--- /locker/sql/bin/get-password	(revision 1036)
+++ /locker/sql/bin/get-password	(revision 1037)
@@ -12,13 +12,25 @@
 	global $env_user;
 	$cnfFile = file_get_contents($path);
-	preg_match('/\[mysql\][^\[]*host=([^\n]*)/',$cnfFile,$match);
-	$host = $match[1];
-	preg_match('/\[mysql\][^\[]*user=([^\n]*)/',$cnfFile,$match);
-	$user = $match[1];
-	preg_match('/\[mysql\][^\[]*password=([^\n]*)/',$cnfFile,$match);
-	$password = $match[1];
-	if (empty($host)) $host = 'sql.mit.edu';
-	if (empty($user)) $user = $env_user;
-	if (empty($password)) $password = 'password';
+	if (preg_match('/\[mysql\][^\[]*host *= *([^\n]*)/',$cnfFile,$match)) {
+		$host = $match[1];
+	} elseif (preg_match('/\[client\][^\[]*host *= *([^\n]*)/',$cnfFile,$match)) {
+		$host = $match[1];
+	} else {
+		$host = 'sql.mit.edu';
+	}
+	if (preg_match('/\[mysql\][^\[]*user *= *([^\n]*)/',$cnfFile,$match)) {
+		$user = $match[1];
+	} elseif (preg_match('/\[client\][^\[]*user *= *([^\n]*)/',$cnfFile,$match)) {
+		$user = $match[1];
+	} else {
+		$user = $env_user;
+	}
+	if (preg_match('/\[mysql\][^\[]*password *= *([^\n]*)/',$cnfFile,$match)) {
+		$password = $match[1];
+	} elseif (preg_match('/\[client\][^\[]*password *= *([^\n]*)/',$cnfFile,$match)) {
+		$password = $match[1];
+	} else {
+		$password = 'password';
+	}
 	return array($host,$user,$password);
 }
