Software /
code /
prosody
Comparison
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 |
parent | 3550:5e5d136d9de0 |
child | 5776:bd0ff8ae98a8 |
comparison
equal
deleted
inserted
replaced
4999:d5a3c5c1873c | 5000:58c9519dc461 |
---|---|
76 end | 76 end |
77 end | 77 end |
78 end | 78 end |
79 | 79 |
80 -- create a new SASL object which can be used to authenticate clients | 80 -- create a new SASL object which can be used to authenticate clients |
81 function new(realm, service_name, app_name) | 81 -- host_fqdn may be nil in which case gethostname() gives the value. |
82 -- For GSSAPI, this determines the hostname in the service ticket (after | |
83 -- reverse DNS canonicalization, only if [libdefaults] rdns = true which | |
84 -- is the default). | |
85 function new(realm, service_name, app_name, host_fqdn) | |
82 | 86 |
83 init(app_name or service_name); | 87 init(app_name or service_name); |
84 | 88 |
85 local st, ret = pcall(cyrussasl.server_new, service_name, nil, realm, nil, nil) | 89 local st, ret = pcall(cyrussasl.server_new, service_name, host_fqdn, realm, nil, nil) |
86 if not st then | 90 if not st then |
87 log("error", "Creating SASL server connection failed: %s", ret); | 91 log("error", "Creating SASL server connection failed: %s", ret); |
88 return nil; | 92 return nil; |
89 end | 93 end |
90 | 94 |