From 110397f05900e81321a18617c6292df7f742eafb Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 4 Nov 2010 19:41:12 +0100 Subject: Don't use deprecated ldap_bind_s ldap_bind_s is marked as deprecated in new libldap releases. Signed-off-by: Simo Sorce --- ipa-client/ipa-getkeytab.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'ipa-client/ipa-getkeytab.c') diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c index 85886526..19f8b21d 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; -- cgit