diff options
author | Tim Potter <tpot@samba.org> | 2005-04-25 12:15:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:11:40 -0500 |
commit | c06297f776d92354e92f0ddda659778d57f426e5 (patch) | |
tree | 95e00fd82df7515cb9f209bcdc1db5daaeb39e19 /source4/scripting/swig | |
parent | e7b92b10aab662f0475679387d6e0f3438973318 (diff) | |
download | samba-c06297f776d92354e92f0ddda659778d57f426e5.tar.gz samba-c06297f776d92354e92f0ddda659778d57f426e5.tar.bz2 samba-c06297f776d92354e92f0ddda659778d57f426e5.zip |
r6469: Add CreateDomainGroup, GetAliasMembership.
(This used to be commit acf1d0a1b554736361f38bcd74961d4e6c1b12bd)
Diffstat (limited to 'source4/scripting/swig')
-rw-r--r-- | source4/scripting/swig/samr.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/source4/scripting/swig/samr.py b/source4/scripting/swig/samr.py index 8c0d3d32c0..4ba58c1c04 100644 --- a/source4/scripting/swig/samr.py +++ b/source4/scripting/swig/samr.py @@ -394,6 +394,32 @@ class DomainHandle(SamrHandle): return ([dcerpc.uint32_array_getitem(r.data_out.rids.ids, i) for i in range(r.data_out.rids.count)], [dcerpc.uint32_array_getitem(r.data_out.types.ids, i) for i in range(r.data_out.types.count)]) + def CreateDomainGroup(self, domain_name, access_mask = 0x02000000): + + r = dcerpc.samr_CreateDomainGroup() + r.data_in.domain_handle = self.handle + r.data_in.name = dcerpc.samr_String() + r.data_in.name.string = domain_name + r.data_in.access_mask = access_mask + + call_fn(dcerpc.dcerpc_samr_CreateDomainGroup, self.pipe, r) + + def GetAliasMembership(self, sids): + + r = dcerpc.samr_GetAliasMembership() + r.data_in.domain_handle = self.handle + r.data_in.sids = dcerpc.lsa_SidArray() + r.data_in.sids.num_sids = len(sids) + r.data_in.sids.sids = dcerpc.new_lsa_SidPtr_array(len(sids)) + + for i in range(len(sids)): + s = dcerpc.lsa_SidPtr() + s.sid = string_to_sid(sids[i]) + dcerpc.lsa_SidPtr_array_setitem(r.data_in.sids.sids, i, s) + + call_fn(dcerpc.dcerpc_samr_GetAliasMembership, self.pipe, r) + + return [r.ids[x] x in range(r.count)] class UserHandle(SamrHandle): @@ -526,10 +552,6 @@ def Connect5(pipe, system_name = '', access_mask = 0x02000000): return ConnectHandle(pipe, r.data_out.connect_handle) - -# CreateDomainGroup -# GetAliasMembership -# LookupNames # QueryGroupInfo # SetGroupInfo # AddGroupMember |