1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-28 11:42:03 +03:00

s4-samdb: seqence_number() operation must be in a transaction

This commit is contained in:
Amitay Isaacs
2011-11-28 17:19:50 +11:00
parent 49926a2ac6
commit 13545d781b

View File

@ -829,3 +829,17 @@ accountExpires: %u
if sd:
m["nTSecurityDescriptor"] = ndr_pack(sd)
self.add(m)
def sequence_number(self, seq_type):
"""Returns the value of the sequence number according to the requested type
:param seq_type: type of sequence number
"""
self.transaction_start()
try:
seq = super(SamDB, self).sequence_number(seq_type)
except Exception:
self.transaction_cancel()
raise
else:
self.transaction_commit()
return seq