From: Thomas Hochstein Date: Sun, 19 Jan 2014 17:19:47 +0000 (+0100) Subject: Add check for empty attributes to perl_mysql X-Git-Url: https://code.th-h.de/?p=usenet%2FINN.git;a=commitdiff_plain;h=c1ede6dbc12671a9a696b2e0dddc609c93c70c82 Add check for empty attributes to perl_mysql Signed-off-by: Thomas Hochstein --- diff --git a/auth/perl_mysql b/auth/perl_mysql index 5f70039..dc963ec 100644 --- a/auth/perl_mysql +++ b/auth/perl_mysql @@ -56,6 +56,11 @@ sub authenticate() { # $attributes{username} username # $attributes{password} password + # return if username or password not set + if (!defined($attributes{username}) or !defined($attributes{password})) { + return (481, 'Authentication failure'); + } + ### DB init my $dbs = sprintf('DBI:%s:database=%s;host=%s',$conf{'dbdriver'},$conf{'database'},$conf{'dbhost'}); my $dbhandle = DBI->connect($dbs, $conf{'dbuser'}, $conf{'dbpw'}, { PrintError => 1 });