diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-06-17 12:02:23 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-06-17 05:43:18 +0200 |
commit | 0c3075cb57134f6171c332158c3052e05dace595 (patch) | |
tree | a2a7d90a8c992eace35419691206107e27f396e7 /source4/scripting/python | |
parent | a8269792aa7c75b82b5ccab0e3b819601f7a4ef4 (diff) | |
download | samba-0c3075cb57134f6171c332158c3052e05dace595.tar.gz samba-0c3075cb57134f6171c332158c3052e05dace595.tar.bz2 samba-0c3075cb57134f6171c332158c3052e05dace595.zip |
s4-pysamdb: fixed the normalisation of grouptype in group add
ldap integers are signed
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jun 17 05:43:18 CEST 2011 on sn-devel-104
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index b513ac8fff..53346e8670 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -142,7 +142,7 @@ pwdLastSet: 0 "objectClass": "group"} if grouptype is not None: - ldbmessage["groupType"] = "%d" % grouptype + ldbmessage["groupType"] = self.normalise_int32(grouptype) if description is not None: ldbmessage["description"] = description @@ -722,3 +722,9 @@ accountExpires: %u if sd: m["nTSecurityDescriptor"] = ndr_pack(sd) self.add(m) + + def normalise_int32(self, ivalue): + '''normalise a ldap integer to signed 32 bit''' + if int(ivalue) & 0x80000000: + return str(int(ivalue) - 0x100000000) + return str(ivalue) |