summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipa-client/ipa-join.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ipa-client/ipa-join.c b/ipa-client/ipa-join.c
index d23348954..86b1bd122 100644
--- a/ipa-client/ipa-join.c
+++ b/ipa-client/ipa-join.c
@@ -213,8 +213,13 @@ connect_ldap(const char *hostname, const char *binddn, const char *bindpw) {
goto fail;
}
- bindpw_bv.bv_val = discard_const(bindpw);
- bindpw_bv.bv_len = strlen(bindpw);
+ if (bindpw) {
+ bindpw_bv.bv_val = discard_const(bindpw);
+ bindpw_bv.bv_len = strlen(bindpw);
+ } else {
+ bindpw_bv.bv_val = NULL;
+ bindpw_bv.bv_len = 0;
+ }
ret = ldap_sasl_bind_s(ld, binddn, LDAP_SASL_SIMPLE, &bindpw_bv,
NULL, NULL, NULL);