diff util/sasl_cyrus.lua @ 5000:58c9519dc461

mod_auth_cyrus, util.sasl_cyrus: Add new option 'cyrus_server_fqdn' to override the hostname passed to Cyrus (and used in e.g. GSSAPI/Kerberos) - fixes #295
author Matthew Wild <mwild1@gmail.com>
date Tue, 24 Jul 2012 10:56:47 +0100
parents 5e5d136d9de0
children bd0ff8ae98a8
line wrap: on
line diff
--- a/util/sasl_cyrus.lua	Tue Jul 24 10:44:37 2012 +0100
+++ b/util/sasl_cyrus.lua	Tue Jul 24 10:56:47 2012 +0100
@@ -78,11 +78,15 @@
 end
 
 -- create a new SASL object which can be used to authenticate clients
-function new(realm, service_name, app_name)
+-- host_fqdn may be nil in which case gethostname() gives the value. 
+--      For GSSAPI, this determines the hostname in the service ticket (after
+--      reverse DNS canonicalization, only if [libdefaults] rdns = true which
+--      is the default).  
+function new(realm, service_name, app_name, host_fqdn)
 
 	init(app_name or service_name);
 
-	local st, ret = pcall(cyrussasl.server_new, service_name, nil, realm, nil, nil)
+	local st, ret = pcall(cyrussasl.server_new, service_name, host_fqdn, realm, nil, nil)
 	if not st then
 		log("error", "Creating SASL server connection failed: %s", ret);
 		return nil;