mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
Fix pointers when pushing strings to python during pidl generation.
(This used to be commit ca72187b3e
)
This commit is contained in:
@ -952,16 +952,15 @@ sub ConvertObjectToPythonLevel($$$$$)
|
||||
$self->pidl("}");
|
||||
}
|
||||
} elsif ($l->{TYPE} eq "ARRAY") {
|
||||
if (is_charset_array($e, $l)) {
|
||||
$var_name = get_pointer_to($var_name);
|
||||
# FIXME: Use Unix charset setting rather than utf-8
|
||||
$self->pidl("$py_var = PyUnicode_Decode($var_name, strlen($var_name), \"utf-8\", \"ignore\");");
|
||||
} else {
|
||||
my $pl = GetPrevLevel($e, $l);
|
||||
if ($pl && $pl->{TYPE} eq "POINTER") {
|
||||
$var_name = get_pointer_to($var_name);
|
||||
}
|
||||
|
||||
if (is_charset_array($e, $l)) {
|
||||
# FIXME: Use Unix charset setting rather than utf-8
|
||||
$self->pidl("$py_var = PyUnicode_Decode($var_name, strlen($var_name), \"utf-8\", \"ignore\");");
|
||||
} else {
|
||||
die("No SIZE_IS for array $var_name") unless (defined($l->{SIZE_IS}));
|
||||
my $length = $l->{SIZE_IS};
|
||||
if (defined($l->{LENGTH_IS})) {
|
||||
|
@ -27,6 +27,8 @@ class UnixinfoTests(RpcInterfaceTestCase):
|
||||
def test_getpwuid(self):
|
||||
infos = self.conn.GetPWUid(range(512))
|
||||
self.assertEquals(512, len(infos))
|
||||
self.assertEquals("", infos[0].shell)
|
||||
self.assertEquals("", infos[0].homedir)
|
||||
|
||||
def test_gidtosid(self):
|
||||
self.conn.GidToSid(1000)
|
||||
|
Reference in New Issue
Block a user