Skip to content

Commit

Permalink
Clean up const qualifier warnings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
greghudson committed Dec 10, 2015
1 parent 360237d commit 66acc3b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions src/lib/kadm5/srv/server_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/kdb/ldap/libkdb_ldap/kdb_ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66acc3b

Please sign in to comment.