]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Clean up const qualifier warnings
authorGreg Hudson <ghudson@mit.edu>
Wed, 9 Dec 2015 21:44:11 +0000 (16:44 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 10 Dec 2015 21:11:07 +0000 (16:11 -0500)
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
src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c

index b6c2bb292afa483125bad13fcb98838968964830..bfeccfdf6e32d2ebf932d2f052411da24f897b2b 100644 (file)
@@ -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;
index 151edb9097dd4dcf192ffc6da5485b76a4ca121f..7ba8075cb849ce85f5800dfaebc8466d71bed38b 100644 (file)
@@ -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);