diff options
author | Tim Potter <tpot@samba.org> | 2004-11-07 00:41:43 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:36 -0500 |
commit | 3503373ba5af647a6da14b80385a5c1084c3112f (patch) | |
tree | 10c587dce232259d10564b6267c00e05dcb92066 /source4 | |
parent | 7c400a840bb465180cd2d86034441cb4ccf79816 (diff) | |
download | samba-3503373ba5af647a6da14b80385a5c1084c3112f.tar.gz samba-3503373ba5af647a6da14b80385a5c1084c3112f.tar.bz2 samba-3503373ba5af647a6da14b80385a5c1084c3112f.zip |
r3588: Fix bug in converting SIDs containing large unsigned integers from Python.
(This used to be commit a46aba43549e5221ec0c15d4133444d8ef77a4fb)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/swig/dcerpc.i | 6 | ||||
-rwxr-xr-x | source4/scripting/swig/torture/samr.py | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/source4/scripting/swig/dcerpc.i b/source4/scripting/swig/dcerpc.i index 560345525f..27afb6471c 100644 --- a/source4/scripting/swig/dcerpc.i +++ b/source4/scripting/swig/dcerpc.i @@ -119,9 +119,9 @@ uint32 uint32_from_python(PyObject *obj, char *name) } if (PyLong_Check(obj)) - return (uint32)PyLong_AsLong(obj); - else - return (uint32)PyInt_AsLong(obj); + return (uint32)PyLong_AsUnsignedLongMask(obj); + + return (uint32)PyInt_AsLong(obj); } PyObject *uint32_to_python(uint32 obj) diff --git a/source4/scripting/swig/torture/samr.py b/source4/scripting/swig/torture/samr.py index 435b3a81db..f7c33baeb3 100755 --- a/source4/scripting/swig/torture/samr.py +++ b/source4/scripting/swig/torture/samr.py @@ -864,6 +864,18 @@ def test_LongInt(pipe): result = dcerpc.samr_Connect(pipe, r) + # Test that we can parse a SID that contains a sub_auth that can't + # be held in a python int. + + r = {} + r['connect_handle'] = result['connect_handle'] + r['access_mask'] = 0x02000000 + r['sid'] = {'sid_rev_num': 1, 'id_auth': [0, 0, 0, 0, 0, 5], + 'num_auths': 4, + 'sub_auths': [21, 737922324, 3002806791L, 1285293260]} + + result = dcerpc.samr_OpenDomain(pipe, r) + def runtests(binding, domain, username, password): print 'Testing SAMR pipe' |