1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

s4:python/samba/ndr.py: add an optional 'allow_remaining' to ndr_unpack()

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Jan  9 10:28:30 CET 2012 on sn-devel-104
This commit is contained in:
Stefan Metzmacher 2012-01-05 16:34:02 +01:00
parent 1be5e58958
commit 507e75ebb9

@ -33,15 +33,16 @@ def ndr_pack(object):
return ndr_pack()
def ndr_unpack(cls, data):
def ndr_unpack(cls, data, allow_remaining=False):
"""NDR unpack an object.
:param cls: Class of the object to unpack
:param data: Buffer to unpack
:param allow_remaining: allows remaining data at the end (default=False)
:return: Unpacked object
"""
object = cls()
object.__ndr_unpack__(data)
object.__ndr_unpack__(data, allow_remaining=allow_remaining)
return object