Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Support logging in as a user that has no password.
Mysql supports accounts without passwords; having no password is _not_ the same as having an empty (zero-length string) password.
  • Loading branch information
piscisaureus committed Aug 20, 2010
1 parent 4d012d6 commit 5d83dc0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/mysql/client.js
Expand Up @@ -210,8 +210,14 @@ Client.prototype._handlePacket = function(packet) {
};

Client.prototype._sendAuth = function(greeting) {
var token = auth.token(this.password, greeting.scrambleBuffer),
packetSize = (
var token;
if (this.password || this.password === '' || this.password === 0) {
token = auth.token(this.password, greeting.scrambleBuffer);
} else {
token = "";
}

var packetSize = (
4 + 4 + 1 + 23 +
this.user.length + 1 +
token.length + 1 +
Expand Down

0 comments on commit 5d83dc0

Please sign in to comment.