kdc: add audit plugin API to windc API

Allow the windc plugin to also implement an audit callback. As part of this
change, both the HDB and windc audit function signatures are changed to return
void.
This commit is contained in:
Luke Howard
2022-01-02 21:19:43 +11:00
parent 98070b5eaa
commit a4c6b81ce9
6 changed files with 87 additions and 41 deletions

View File

@@ -343,18 +343,20 @@ _kdc_include_pac_p(astgs_request_t r)
}
/*
* Notify the HDB backend of the audited event.
* Notify the HDB backend and windc plugin of the audited event.
*/
krb5_error_code
_kdc_hdb_audit(astgs_request_t r)
_kdc_audit_request(astgs_request_t r)
{
krb5_error_code ret;
struct HDB *hdb;
hdb = r->clientdb ? r->clientdb : r->config->db[0];
ret = _kdc_windc_audit(r);
if (ret == 0 &&
(hdb = r->clientdb ? r->clientdb : r->config->db[0]) &&
hdb->hdb_audit)
ret = hdb->hdb_audit(r->context, hdb, r->client, (hdb_request_t)r);
if (hdb && hdb->hdb_audit)
return hdb->hdb_audit(r->context, hdb, r->client, (hdb_request_t)r);
return 0;
return ret;
}