mod_auth_*: Get rid of undocumented and broken 'sasl_realm' config option.
authorWaqas Hussain <waqas20@gmail.com>
Wed, 23 Feb 2011 01:34:46 +0500
changeset 4191 dfeae208e5b4
parent 4190 6f509033f855
child 4192 c1e4d8326ab0
mod_auth_*: Get rid of undocumented and broken 'sasl_realm' config option.
plugins/mod_auth_anonymous.lua
plugins/mod_auth_cyrus.lua
plugins/mod_auth_internal_hashed.lua
plugins/mod_auth_internal_plain.lua
--- a/plugins/mod_auth_anonymous.lua	Wed Feb 23 01:22:04 2011 +0500
+++ b/plugins/mod_auth_anonymous.lua	Wed Feb 23 01:34:46 2011 +0500
@@ -34,13 +34,12 @@
 	end
 
 	function provider.get_sasl_handler()
-		local realm = module:get_option("sasl_realm") or module.host;
 		local anonymous_authentication_profile = {
 			anonymous = function(sasl, username, realm)
 				return true; -- for normal usage you should always return true here
 			end
 		};
-		return new_sasl(realm, anonymous_authentication_profile);
+		return new_sasl(module.host, anonymous_authentication_profile);
 	end
 
 	return provider;
--- a/plugins/mod_auth_cyrus.lua	Wed Feb 23 01:22:04 2011 +0500
+++ b/plugins/mod_auth_cyrus.lua	Wed Feb 23 01:34:46 2011 +0500
@@ -28,9 +28,8 @@
 end
 
 do -- diagnostic
-	local realm = module:get_option("sasl_realm") or module.host;
 	local list;
-	for mechanism in pairs(new_sasl(realm):mechanisms()) do
+	for mechanism in pairs(new_sasl(module.host):mechanisms()) do
 		list = (not(list) and mechanism) or (list..", "..mechanism);
 	end
 	if not list then
@@ -68,8 +67,7 @@
 	end
 
 	function provider.get_sasl_handler()
-		local realm = module:get_option("sasl_realm") or module.host;
-		local handler = new_sasl(realm);
+		local handler = new_sasl(module.host);
 		if require_provisioning then
 			function handler.require_provisioning(username)
 				return usermanager_user_exists(username, module.host);
--- a/plugins/mod_auth_internal_hashed.lua	Wed Feb 23 01:22:04 2011 +0500
+++ b/plugins/mod_auth_internal_hashed.lua	Wed Feb 23 01:34:46 2011 +0500
@@ -140,7 +140,6 @@
 	end
 
 	function provider.get_sasl_handler()
-		local realm = module:get_option("sasl_realm") or module.host;
 		local testpass_authentication_profile = {
 			plain_test = function(sasl, username, password, realm)
 				local prepped_username = nodeprep(username);
@@ -175,7 +174,7 @@
 				return stored_key, server_key, iteration_count, salt, true;
 			end
 		};
-		return new_sasl(realm, testpass_authentication_profile);
+		return new_sasl(module.host, testpass_authentication_profile);
 	end
 	
 	return provider;
--- a/plugins/mod_auth_internal_plain.lua	Wed Feb 23 01:22:04 2011 +0500
+++ b/plugins/mod_auth_internal_plain.lua	Wed Feb 23 01:34:46 2011 +0500
@@ -68,7 +68,6 @@
 	end
 
 	function provider.get_sasl_handler()
-		local realm = module:get_option("sasl_realm") or module.host;
 		local getpass_authentication_profile = {
 			plain = function(sasl, username, realm)
 				local prepped_username = nodeprep(username);
@@ -83,7 +82,7 @@
 				return password, true;
 			end
 		};
-		return new_sasl(realm, getpass_authentication_profile);
+		return new_sasl(module.host, getpass_authentication_profile);
 	end
 	
 	return provider;