Software /
code /
prosody-modules
Changeset
2775:8407137c0a3b
mod_auth_ldap: Add annotations to ignore harmless warnings [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 26 Sep 2017 12:35:25 +0200 |
parents | 2774:41565a743cad |
children | 2776:3092ae96c1f0 |
files | mod_auth_ldap/mod_auth_ldap.lua |
diffstat | 1 files changed, 5 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mod_auth_ldap/mod_auth_ldap.lua Tue Sep 26 12:35:08 2017 +0200 +++ b/mod_auth_ldap/mod_auth_ldap.lua Tue Sep 26 12:35:25 2017 +0200 @@ -31,6 +31,7 @@ if not ld then return nil, err, "reconnect"; end end + -- luacheck: ignore 411/success local success, iterator, invariant, initial = pcall(ld[method], ld, ...); if not success then ld = nil; return nil, iterator, "search"; end @@ -42,7 +43,7 @@ function ldap_do(method, retry_count, ...) local dn, attr, where; - for i=1,1+retry_count do + for _=1,1+retry_count do dn, attr, where = ldap_do_once(method, ...); if dn or not(attr) then break; end -- nothing or something found module:log("warn", "LDAP: %s %s (in %s)", tostring(dn), tostring(attr), where); @@ -69,7 +70,7 @@ local provider = {}; -function provider.create_user(username, password) +function provider.create_user(username, password) -- luacheck: ignore 212 return nil, "Account creation not available with LDAP."; end @@ -98,7 +99,7 @@ function provider.get_sasl_handler() return new_sasl(module.host, { - plain = function(sasl, username) + plain = function(sasl, username) -- luacheck: ignore 212/sasl local password = provider.get_password(username); if not password then return "", nil; end return password, true; @@ -118,7 +119,7 @@ function provider.get_sasl_handler() return new_sasl(module.host, { - plain_test = function(sasl, username, password) + plain_test = function(sasl, username, password) -- luacheck: ignore 212/sasl return provider.test_password(username, password), true; end });