mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
python: Cope with the dom_sid2 alias in pidl's python generating code.
This fixes some problems in the samr Python bindings that pidl was (correctly) warning about.
This commit is contained in:
@ -766,6 +766,11 @@ sub register_module_import($$)
|
||||
sub use_type_variable($$)
|
||||
{
|
||||
my ($self, $orig_ctype) = @_;
|
||||
# FIXME: Have a global lookup table for types that look different on the
|
||||
# wire than they are named in C?
|
||||
if ($orig_ctype->{NAME} eq "dom_sid2") {
|
||||
$orig_ctype->{NAME} = "dom_sid";
|
||||
}
|
||||
my $ctype = resolveType($orig_ctype);
|
||||
unless (defined($ctype->{BASEFILE})) {
|
||||
return undef;
|
||||
@ -840,8 +845,7 @@ sub ConvertObjectFromPythonData($$$$$$;$)
|
||||
my $ctype_name = $self->use_type_variable($ctype);
|
||||
unless (defined ($ctype_name)) {
|
||||
error($location, "Unable to determine origin of type `" . mapTypeName($ctype) . "'");
|
||||
$self->assign($target, "NULL");
|
||||
# FIXME:
|
||||
$self->pidl("PyErr_SetString(PyExc_TypeError, \"Can not convert C Type " . mapType($ctype) . " to Python\");");
|
||||
return;
|
||||
}
|
||||
$self->pidl("PY_CHECK_TYPE($ctype_name, $cvar, $fail);");
|
||||
|
@ -67,7 +67,7 @@ def test_EnumDomainUsers(samr, dom_handle):
|
||||
users = toArray(samr.EnumDomainUsers(dom_handle, 0, 0, -1))
|
||||
print "Found %d users" % len(users)
|
||||
for idx, user in users:
|
||||
print "\t%s\t(%d)" % (user, idx)
|
||||
print "\t%s\t(%d)" % (user.string, idx)
|
||||
|
||||
def test_EnumDomainGroups(samr, dom_handle):
|
||||
"""test the samr_EnumDomainGroups interface"""
|
||||
@ -75,7 +75,7 @@ def test_EnumDomainGroups(samr, dom_handle):
|
||||
groups = toArray(samr.EnumDomainGroups(dom_handle, 0, 0))
|
||||
print "Found %d groups" % len(groups)
|
||||
for idx, group in groups:
|
||||
print "\t%s\t(%d)" % (group, idx)
|
||||
print "\t%s\t(%d)" % (group.string, idx)
|
||||
|
||||
def test_domain_ops(samr, dom_handle):
|
||||
"""test domain specific ops"""
|
||||
|
Reference in New Issue
Block a user