迁移到非弃用的ldap函数时出错

iya*_*sar 5 c openldap

我正在将已弃用的ldap函数更改为不推荐使用的函数.但我遇到了问题ldap_sasl_bind_s. It returns error code 49,这意味着无效的凭据.但我确信凭证有效.否则我补充说

TLS_REQCERT never

TLSVerifyClient never  
Run Code Online (Sandbox Code Playgroud)

/etc/openldap/ldap.conf.我仍然得到错误.

ldap_simple_bind_s(q->ld, binddn, creds.bv_val);  //works well

ldap_sasl_bind_s(q->ld, binddn, LDAP_SASL_SIMPLE , &creds, NULL, NULL, NULL); //returns ldap error code 49 but continues working
Run Code Online (Sandbox Code Playgroud)

主要的问题是:当我使用ldap_sasl_bind_s时,它不会绑定我的ldap架构中的所有attrbiutes.此外,当我搜索现有属性时,它返回NOSUCH错误.

任何帮助,将不胜感激.

小智 0

基本的 C 编程涵盖了超级基础知识,尽管有些东西告诉我你已经读过这些东西了:(我无法从你的问题中判断你的应用程序是外部的还是你正在从 openldap 中移动不推荐使用的函数?源)

你读过这份文件ldap_simple_bind吗?它向我表明,ldap_sasl_bind_s如果char *LDAP_SASL_SIMPLE = 0;