简体   繁体   English

ldap3 python Modify用过滤器替换对象

[英]ldap3 python modify replace an object with filter

How can we filter when applying ldapmodify? 应用ldapmodify时如何过滤?

For eg: this is how my user object looks like: 例如:这是我的用户对象的样子:

dn: mail=abc@d.com,ou=users,dc=dev,dc=com sn: po givenName: abc pin: 1234 mail: abc@d.com telephoneNumber: 11234567890 enabled: FALSE city: city cn: abc@d.com o: org

I want to modify this user's city if his org is org. 如果他的单位是org,我想修改该用户的城市。 How can I apply such a filter? 如何应用这种过滤器?

I am doing it using ldap3, do I need to use controls? 我正在使用ldap3进行操作,是否需要使用控件?

You need to send the Assertion Control along with your modify operation (see RFC 4528 ). 您需要将声明控制与您的修改操作一起发送(请参阅RFC 4528 )。 Basically the control contains a filter which has to be matched. 基本上,控件包含一个必须匹配的过滤器。

I'm using this control in my web2ldap to prevent concurrent writes to do anything bad. 我在web2ldap中使用此控件来防止并发写入会做任何不好的事情。

I have some doubts that ldap3 module supports it out-of-the-box though. 我对ldap3模块是否开箱即用表示怀疑。

Further notes: 进一步说明:

  • Not all LDAP servers support this control. 并非所有的LDAP服务器都支持此控件。
  • There are subtle bugs in LDAP server implementations supporting this control. LDAP服务器实现中存在支持此控件的细微错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM