From: Jelmer Vernooij Date: Thu, 18 Dec 2008 20:43:05 +0000 (+0000) Subject: Cope with slight changes in tdb API. X-Git-Tag: samba-4.0.0alpha6~462^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21702bfcdece4e71dcb4ab50e111911a5777f9a5;p=thirdparty%2Fsamba.git Cope with slight changes in tdb API. --- diff --git a/source4/scripting/python/samba/samba3.py b/source4/scripting/python/samba/samba3.py index 0e0c29dac82..a3dac27709a 100644 --- a/source4/scripting/python/samba/samba3.py +++ b/source4/scripting/python/samba/samba3.py @@ -25,9 +25,28 @@ REGISTRY_VALUE_PREFIX = "SAMBA_REGVAL" REGISTRY_DB_VERSION = 1 import os +import struct import tdb +def fetch_uint32(tdb, key): + try: + data = tdb[key] + except KeyError: + return None + assert len(data) == 4 + return struct.unpack("