Merge pull request #5266 from mailcow/staging

[Dovecot] remove pass return in Dovecot lua auth
This commit is contained in:
Niklas Meyer 2023-05-30 16:57:10 +02:00 committed by GitHub
commit e691d2c782
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -159,7 +159,7 @@ function auth_password_verify(req, pass)
VALUES ("%s", 0, "%s", "%s")]], con:escape(req.service), con:escape(req.user), con:escape(req.real_rip))) VALUES ("%s", 0, "%s", "%s")]], con:escape(req.service), con:escape(req.user), con:escape(req.real_rip)))
cur:close() cur:close()
con:close() con:close()
return dovecot.auth.PASSDB_RESULT_OK, "password=pass" return dovecot.auth.PASSDB_RESULT_OK, ""
end end
row = cur:fetch (row, "a") row = cur:fetch (row, "a")
end end
@ -180,13 +180,13 @@ function auth_password_verify(req, pass)
if tostring(req.real_rip) == "__IPV4_SOGO__" then if tostring(req.real_rip) == "__IPV4_SOGO__" then
cur:close() cur:close()
con:close() con:close()
return dovecot.auth.PASSDB_RESULT_OK, "password=pass" return dovecot.auth.PASSDB_RESULT_OK, ""
elseif row.has_prot_access == "1" then elseif row.has_prot_access == "1" then
con:execute(string.format([[REPLACE INTO sasl_log (service, app_password, username, real_rip) con:execute(string.format([[REPLACE INTO sasl_log (service, app_password, username, real_rip)
VALUES ("%s", %d, "%s", "%s")]], con:escape(req.service), row.id, con:escape(req.user), con:escape(req.real_rip))) VALUES ("%s", %d, "%s", "%s")]], con:escape(req.service), row.id, con:escape(req.user), con:escape(req.real_rip)))
cur:close() cur:close()
con:close() con:close()
return dovecot.auth.PASSDB_RESULT_OK, "password=pass" return dovecot.auth.PASSDB_RESULT_OK, ""
end end
end end
row = cur:fetch (row, "a") row = cur:fetch (row, "a")