diff options
Diffstat (limited to 'ipa-client')
-rw-r--r-- | ipa-client/ipa-getkeytab.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c index 858865269..19f8b21d6 100644 --- a/ipa-client/ipa-getkeytab.c +++ b/ipa-client/ipa-getkeytab.c @@ -58,6 +58,10 @@ #define KEYTAB_SET_OID "2.16.840.1.113730.3.8.3.1" #define KEYTAB_RET_OID "2.16.840.1.113730.3.8.3.2" +#ifndef discard_const +#define discard_const(ptr) ((void *)((uintptr_t)(ptr))) +#endif + struct krb_key_salt { krb5_enctype enctype; krb5_int32 salttype; @@ -576,7 +580,13 @@ static int ldap_set_keytab(krb5_context krbctx, } if (binddn) { - ret = ldap_bind_s(ld, binddn, bindpw, LDAP_AUTH_SIMPLE); + struct berval bv; + + bv.bv_val = discard_const(bindpw); + bv.bv_len = strlen(bindpw); + + ret = ldap_sasl_bind_s(ld, binddn, LDAP_SASL_SIMPLE, &bv, + NULL, NULL, NULL); if (ret != LDAP_SUCCESS) { fprintf(stderr, _("Simple bind failed\n")); goto error_out; |