From 4a7ac71054f74dea5dad7d94640862705d0cb582 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Tue, 13 Jul 2010 16:09:01 +0000 Subject: [PATCH] Addendum to r24185: make audit_as_req return void, since it's an informational method and we're not going to do anything with the result. ticket: 6749 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24186 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/kdb.h | 20 +++++++------------- src/kdc/kdc_util.c | 4 ++-- src/lib/kdb/kdb5.c | 11 ++++------- src/plugins/kdb/db2/db2_exp.c | 10 +++++----- src/plugins/kdb/db2/kdb_db2.c | 4 ++-- src/plugins/kdb/db2/kdb_db2.h | 2 +- src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c | 4 ++-- src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h | 2 +- 8 files changed, 24 insertions(+), 33 deletions(-) diff --git a/src/include/kdb.h b/src/include/kdb.h index a359f9095..977867b49 100644 --- a/src/include/kdb.h +++ b/src/include/kdb.h @@ -615,12 +615,9 @@ krb5_error_code krb5_db_check_policy_tgs(krb5_context kcontext, const char **status, krb5_data *e_data); -krb5_error_code krb5_db_audit_as_req(krb5_context kcontext, - krb5_kdc_req *request, - krb5_db_entry *client, - krb5_db_entry *server, - krb5_timestamp authtime, - krb5_error_code error_code); +void krb5_db_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, + krb5_db_entry *client, krb5_db_entry *server, + krb5_timestamp authtime, krb5_error_code error_code); krb5_error_code krb5_db_invoke ( krb5_context kcontext, unsigned int method, @@ -1271,14 +1268,11 @@ typedef struct _kdb_vftabl { /* * Optional: This method informs the module of a successful or unsuccessful - * AS request. The resulting error code is currently ignored by the KDC. + * AS request. */ - krb5_error_code (*audit_as_req)(krb5_context kcontext, - krb5_kdc_req *request, - krb5_db_entry *client, - krb5_db_entry *server, - krb5_timestamp authtime, - krb5_error_code error_code); + void (*audit_as_req)(krb5_context kcontext, krb5_kdc_req *request, + krb5_db_entry *client, krb5_db_entry *server, + krb5_timestamp authtime, krb5_error_code error_code); /* Note: there is currently no method for auditing TGS requests. */ diff --git a/src/kdc/kdc_util.c b/src/kdc/kdc_util.c index 88f3f1f5d..97df9f7fc 100644 --- a/src/kdc/kdc_util.c +++ b/src/kdc/kdc_util.c @@ -2356,8 +2356,8 @@ log_as_req(const krb5_fulladdr *from, ktypestr, fromstring, status, cname2, sname2, emsg ? ", " : "", emsg ? emsg : ""); } - (void) krb5_db_audit_as_req(kdc_context, request, client, server, - authtime, errcode); + krb5_db_audit_as_req(kdc_context, request, client, server, authtime, + errcode); #if 0 /* Sun (OpenSolaris) version would probably something like this. The client and server names passed can be null, unlike in the diff --git a/src/lib/kdb/kdb5.c b/src/lib/kdb/kdb5.c index 5d73828c7..38f26e678 100644 --- a/src/lib/kdb/kdb5.c +++ b/src/lib/kdb/kdb5.c @@ -2303,7 +2303,7 @@ krb5_db_check_policy_tgs(krb5_context kcontext, krb5_kdc_req *request, e_data); } -krb5_error_code +void krb5_db_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code) @@ -2312,12 +2312,9 @@ krb5_db_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, kdb_vftabl *v; status = get_vftabl(kcontext, &v); - if (status) - return status; - if (v->audit_as_req == NULL) - return KRB5_PLUGIN_OP_NOTSUPP; - return v->audit_as_req(kcontext, request, client, server, authtime, - error_code); + if (status || v->audit_as_req == NULL) + return; + v->audit_as_req(kcontext, request, client, server, authtime, error_code); } krb5_error_code diff --git a/src/plugins/kdb/db2/db2_exp.c b/src/plugins/kdb/db2/db2_exp.c index 80c55b24f..da4cecd7f 100644 --- a/src/plugins/kdb/db2/db2_exp.c +++ b/src/plugins/kdb/db2/db2_exp.c @@ -186,11 +186,11 @@ WRAP_K (krb5_db2_check_policy_as, krb5_data *e_data), (kcontext, request, client, server, kdc_time, status, e_data)); -WRAP_K (krb5_db2_audit_as_req, - (krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, - krb5_db_entry *server, krb5_timestamp authtime, - krb5_error_code error_code), - (kcontext, request, client, server, authtime, error_code)); +WRAP_VOID (krb5_db2_audit_as_req, + (krb5_context kcontext, krb5_kdc_req *request, + krb5_db_entry *client, krb5_db_entry *server, + krb5_timestamp authtime, krb5_error_code error_code), + (kcontext, request, client, server, authtime, error_code)); WRAP_K (krb5_db2_invoke, (krb5_context kcontext, diff --git a/src/plugins/kdb/db2/kdb_db2.c b/src/plugins/kdb/db2/kdb_db2.c index 8c6c97afc..f5f8f7b0d 100644 --- a/src/plugins/kdb/db2/kdb_db2.c +++ b/src/plugins/kdb/db2/kdb_db2.c @@ -1650,10 +1650,10 @@ krb5_db2_check_policy_as(krb5_context kcontext, krb5_kdc_req *request, return retval; } -krb5_error_code +void krb5_db2_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code) { - return krb5_db2_lockout_audit(kcontext, client, authtime, error_code); + (void) krb5_db2_lockout_audit(kcontext, client, authtime, error_code); } diff --git a/src/plugins/kdb/db2/kdb_db2.h b/src/plugins/kdb/db2/kdb_db2.h index 0c8095a93..a1d0d1976 100644 --- a/src/plugins/kdb/db2/kdb_db2.h +++ b/src/plugins/kdb/db2/kdb_db2.h @@ -152,7 +152,7 @@ krb5_db2_check_policy_as(krb5_context kcontext, krb5_kdc_req *request, krb5_timestamp kdc_time, const char **status, krb5_data *e_data); -krb5_error_code +void krb5_db2_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code); diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c index 185e1f330..eaf10cf2e 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c @@ -542,10 +542,10 @@ krb5_ldap_check_policy_as(krb5_context kcontext, krb5_kdc_req *request, return retval; } -krb5_error_code +void krb5_ldap_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code) { - return krb5_ldap_lockout_audit(kcontext, client, authtime, error_code); + (void) krb5_ldap_lockout_audit(kcontext, client, authtime, error_code); } diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h index 6c795d656..939defb76 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h +++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.h @@ -302,7 +302,7 @@ krb5_ldap_check_policy_as(krb5_context kcontext, krb5_kdc_req *request, krb5_timestamp kdc_time, const char **status, krb5_data *e_data); -krb5_error_code +void krb5_ldap_audit_as_req(krb5_context kcontext, krb5_kdc_req *request, krb5_db_entry *client, krb5_db_entry *server, krb5_timestamp authtime, krb5_error_code error_code); -- 2.26.2