summaryrefslogtreecommitdiffstats
path: root/ipa-client/ipa-getkeytab.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2010-11-04 19:41:12 +0100
committerSimo Sorce <ssorce@redhat.com>2010-11-22 16:01:35 -0500
commit110397f05900e81321a18617c6292df7f742eafb (patch)
tree6e3fdb9dae793e971af69459bb359d603ccb3482 /ipa-client/ipa-getkeytab.c
parent3b7a86024b53fd0ac1a98e92bd93a170a1979aec (diff)
downloadfreeipa-110397f05900e81321a18617c6292df7f742eafb.tar.gz
freeipa-110397f05900e81321a18617c6292df7f742eafb.tar.xz
freeipa-110397f05900e81321a18617c6292df7f742eafb.zip
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>
Diffstat (limited to 'ipa-client/ipa-getkeytab.c')
-rw-r--r--ipa-client/ipa-getkeytab.c12
1 files changed, 11 insertions, 1 deletions
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;