Bug 41235 - Remove atomic parameter from univention.uldap.access.modify()
Remove atomic parameter from univention.uldap.access.modify()
Status: RESOLVED DUPLICATE of bug 40041
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-05-10 13:00 CEST by Florian Best
Modified: 2018-04-13 13:28 CEST (History)
0 users

See Also:
What kind of report is it?: ---
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Cleanup
Max CVSS v3 score:
best: Patch_Available+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-05-10 13:00:12 CEST
The function parameter 'atomic' is broken (and nowhere used):
univention.uldap.access.modify(dn, changes, atomic=0)

Trying to use this either raises a exception:
>>> lo.modify('cn=foo', [('foo', '1', '2')], atomic=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/fbest/svn/dev/branches/ucs/base/univention-python/modules/uldap.py", line 476, in modify
    ml.append((ldap.MOD_DELETE, key, val))
UnboundLocalError: local variable 'val' referenced before assignment

Or even worse, it changes the modlist to:
>>> lo.modify('cn=foo', [('foo', None, '2'), ('bar', '3', '4')], atomic=True)
→ [(0, 'foo', '2'), (1, 'bar', '2'), (0, 'bar', '2')]

It should simply be removed.

diff --git a/base/univention-python/modules/uldap.py b/base/univention-python/modules/uldap.py
index 580feb2..9258df5 100644
--- a/base/univention-python/modules/uldap.py
+++ b/base/univention-python/modules/uldap.py
@@ -460 +460 @@ def add(self, dn, al):
-       def modify(self, dn, changes, atomic=0):
+       def modify(self, dn, changes):
@@ -475,4 +474,0 @@ def modify(self, dn, changes, atomic=0):
-                               if atomic:
-                                       ml.append((ldap.MOD_DELETE, key, val))
-                                       ml.append((ldap.MOD_ADD, key, val))
-                                       continue
Comment 1 Florian Best univentionstaff 2016-09-15 12:52:05 CEST
removed during Bug #40041

*** This bug has been marked as a duplicate of bug 40041 ***