From 00d4f386b98b1f68e6061e5c647c99f26f9c33a0 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(-)

(limited to 'util')

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