From bd468f86f4341521cf49b058df82b27d5475a4d5 Mon Sep 17 00:00:00 2001
From: Waqas Hussain <waqas20@gmail.com>
Date: Wed, 31 Aug 2011 23:24:13 +0500
Subject: util.sasl.scram: Return proper error and don't touch datastores on
 empty username.

---
 util/sasl/scram.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua
index aad33ebc..055ba16a 100644
--- a/util/sasl/scram.lua
+++ b/util/sasl/scram.lua
@@ -90,7 +90,7 @@ local function validate_username(username)
 	
 	-- apply SASLprep
 	username = saslprep(username);
-	return username;
+	return username and #username>0 and username;
 end
 
 local function hashprep(hashname)
-- 
cgit v1.2.3