HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //proc/722141/root/usr/lib64/python3.6/site-packages/ldap/__pycache__/modlist.cpython-36.pyc
3

�`a�
�@s0dZddlmZddlZddd�Zd	dd�ZdS)
z[
ldap.modlist - create add/modify modlist's

See https://www.python-ldap.org/ for details.
�)�__version__NcCs^dd�|pgD�}g}xB|j�D]6\}}|j�|kr6q dd�|D�}|r |j||f�q W|S)z5Build modify list for call of method LDAPObject.add()cSsh|]}|j��qS�)�lower)�.0�vrr�/usr/lib64/python3.6/modlist.py�	<setcomp>szaddModlist.<locals>.<setcomp>cSsg|]}|dk	r|�qS)Nr)r�itemrrr�
<listcomp>szaddModlist.<locals>.<listcomp>)�itemsr�append)�entry�ignore_attr_types�modlist�attrtype�valueZ
attrvaluelistrrr�
addModlistsrcCs�dd�|pgD�}dd�|pgD�}g}i}x|D]}|||j�<q2W�x.|j�D�] \}}	|j�}
|
|krnqRdd�|	D�}|
|kr�|j||
g�}dd�|D�}||
=ng}|r�|r�|jtj||f�qR|o�|�rXt|�t|�k}
|
�s,|
|k�rdd�|D�}dd�|D�}nt|�}t|�}||k}
|
�rt|jtj|d	f�|jtj||f�qR|rR|rR|jtj|d	f�qRW|�s�x:|j�D].\}}||k�r��q�|}|jtj|d	f��q�W|S)
a�
  Build differential modify list for calling LDAPObject.modify()/modify_s()

  old_entry
      Dictionary holding the old entry
  new_entry
      Dictionary holding what the new entry should be
  ignore_attr_types
      List of attribute type names to be ignored completely
  ignore_oldexistent
      If non-zero attribute type names which are in old_entry
      but are not found in new_entry at all are not deleted.
      This is handy for situations where your application
      sets attribute value to '' for deleting an attribute.
      In most cases leave zero.
  case_ignore_attr_types
      List of attribute type names for which comparison will be made
      case-insensitive
  cSsh|]}|j��qSr)r)rrrrrr1sz modifyModlist.<locals>.<setcomp>cSsh|]}|j��qSr)r)rrrrrr2scSsg|]}|dk	r|�qS)Nr)rr	rrrr
=sz!modifyModlist.<locals>.<listcomp>cSsg|]}|dk	r|�qS)Nr)rr	rrrr
@scSsh|]}|j��qSr)r)rrrrrrLscSsh|]}|j��qSr)r)rrrrrrMsN)	rr�getr�ldapZMOD_ADD�len�setZ
MOD_DELETE)Z	old_entryZ	new_entryrZignore_oldexistentZcase_ignore_attr_typesrZattrtype_lower_map�arrZattrtype_lowerZ	new_valueZ	old_valueZreplace_attr_valueZ
old_value_setZ
new_value_set�valrrr�
modifyModlistsN





r)N)NrN)�__doc__rrrrrrrr�<module>s