mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Don't use deprecated ldap_bind_s
ldap_bind_s is marked as deprecated in new libldap releases. Signed-off-by: Simo Sorce <ssorce@redhat.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user