krb5 commit: Clean up const qualifier warnings
Greg Hudson
ghudson at mit.edu
Thu Dec 10 16:32:08 EST 2015
https://github.com/krb5/krb5/commit/66acc3b529f997f902bf11d3004ddc065d5bea9f
commit 66acc3b529f997f902bf11d3004ddc065d5bea9f
Author: Greg Hudson <ghudson at mit.edu>
Date: Wed Dec 9 16:44:11 2015 -0500
Clean up const qualifier warnings
In server_acl.c, add const qualifiers to the kadm5int_acl_find_entry()
principal parameters, and to the kadm5int_acl_match_data() parameters,
to avoid discarding const qualifiers when calling them. In
kdb_ldap.c, cast the has_rootdse_ava() attribute before passing it to
ldap_search_ext_s(), which does not modify its attrs parameter but
does not declare it with a const qualifier.
src/lib/kadm5/srv/server_acl.c | 16 ++++++----------
src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c | 2 +-
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/src/lib/kadm5/srv/server_acl.c b/src/lib/kadm5/srv/server_acl.c
index b6c2bb2..bfeccfd 100644
--- a/src/lib/kadm5/srv/server_acl.c
+++ b/src/lib/kadm5/srv/server_acl.c
@@ -69,8 +69,8 @@ static const aop_t acl_op_table[] = {
};
typedef struct _wildstate {
- int nwild;
- krb5_data *backref[9];
+ int nwild;
+ const krb5_data *backref[9];
} wildstate_t;
static aent_t *acl_list_head = (aent_t *) NULL;
@@ -548,10 +548,8 @@ kadm5int_acl_load_acl_file()
* Wildcarding is only supported for a whole component.
*/
static krb5_boolean
-kadm5int_acl_match_data(e1, e2, targetflag, ws)
- krb5_data *e1, *e2;
- int targetflag;
- wildstate_t *ws;
+kadm5int_acl_match_data(const krb5_data *e1, const krb5_data *e2,
+ int targetflag, wildstate_t *ws)
{
krb5_boolean retval;
@@ -594,10 +592,8 @@ kadm5int_acl_match_data(e1, e2, targetflag, ws)
* kadm5int_acl_find_entry() - Find a matching entry.
*/
static aent_t *
-kadm5int_acl_find_entry(kcontext, principal, dest_princ)
- krb5_context kcontext;
- krb5_principal principal;
- krb5_principal dest_princ;
+kadm5int_acl_find_entry(krb5_context kcontext, krb5_const_principal principal,
+ krb5_const_principal dest_princ)
{
aent_t *entry;
krb5_error_code kret;
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c
index 151edb9..7ba8075 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c
@@ -132,7 +132,7 @@ has_rootdse_ava(krb5_context context, const char *server_name,
LDAPMessage *msg, *res = NULL;
struct berval cred;
- attrs[0] = attribute;
+ attrs[0] = (char *)attribute;
attrs[1] = NULL;
st = ldap_initialize(&ld, server_name);
More information about the cvs-krb5
mailing list