summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-14 18:59:11 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-01-14 19:53:08 +0100
commitd28eb21a984a733e8f1de51170e41ae7c879f7e9 (patch)
tree251bfe5e423c3f40634aaeb82037584748dbc702
parent134e38ac28b30b7fb3f4efcf9985c17ff2f070ad (diff)
downloadsamba-d28eb21a984a733e8f1de51170e41ae7c879f7e9.tar.gz
samba-d28eb21a984a733e8f1de51170e41ae7c879f7e9.tar.bz2
samba-d28eb21a984a733e8f1de51170e41ae7c879f7e9.zip
python: Compile security module, handle uint.
(This used to be commit dee64344fb13aaed38a550ebb4048d0fa526d5b6)
-rw-r--r--source4/librpc/config.mk3
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/Python.pm6
-rw-r--r--source4/pidl/lib/Parse/Pidl/Typelist.pm1
-rw-r--r--source4/scripting/python/modules.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 31013289dd..cda57bedcf 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -628,3 +628,6 @@ PRIVATE_DEPENDENCIES = dcerpc_samr
[PYTHON::python_lsa]
OBJ_FILES = gen_ndr/py_lsa.o
PRIVATE_DEPENDENCIES = RPC_NDR_LSA
+
+[PYTHON::python_security]
+OBJ_FILES = gen_ndr/py_security.o
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 8ff909a455..31b06d16b8 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -612,7 +612,7 @@ sub ConvertObjectFromPythonData($$$$$$)
if ($actual_ctype->{TYPE} eq "ENUM" or $actual_ctype->{TYPE} eq "BITMAP" or
$actual_ctype->{TYPE} eq "SCALAR" and (
- expandAlias($actual_ctype->{NAME}) =~ /^(u?int[0-9]+|hyper|NTTIME|time_t|NTTIME_hyper|NTTIME_1sec|dlong|udlong|udlongr)$/)) {
+ expandAlias($actual_ctype->{NAME}) =~ /^(u?int[0-9]*|hyper|NTTIME|time_t|NTTIME_hyper|NTTIME_1sec|dlong|udlong|udlongr)$/)) {
$self->pidl("PY_CHECK_TYPE(PyInt, $cvar, $fail);");
$self->pidl("$target = PyInt_AsLong($cvar);");
return;
@@ -748,7 +748,7 @@ sub ConvertScalarToPython($$$)
$ctypename = expandAlias($ctypename);
- if ($ctypename =~ /^(int|long|char|u?int[0-9]+|hyper|dlong|udlong|udlongr|time_t|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
+ if ($ctypename =~ /^(char|u?int[0-9]*|hyper|dlong|udlong|udlongr|time_t|NTTIME_hyper|NTTIME|NTTIME_1sec)$/) {
return "PyInt_FromLong($cvar)";
}
@@ -938,7 +938,7 @@ sub Parse($$$$$)
} elsif ($cvar =~ /^".*"$/) {
$py_obj = "PyString_FromString($cvar)";
} else {
- $py_obj = $self->ConvertObjectToPythonData("NULL", $ctype, $cvar);
+ $py_obj = $self->ConvertObjectToPythonData("NULL", expandAlias($ctype), $cvar);
}
$self->pidl("PyModule_AddObject(m, \"$name\", $py_obj);");
diff --git a/source4/pidl/lib/Parse/Pidl/Typelist.pm b/source4/pidl/lib/Parse/Pidl/Typelist.pm
index 9e6c683f82..8ba1ae47af 100644
--- a/source4/pidl/lib/Parse/Pidl/Typelist.pm
+++ b/source4/pidl/lib/Parse/Pidl/Typelist.pm
@@ -59,6 +59,7 @@ my %aliases = (
"boolean8" => "uint8",
"boolean32" => "uint32",
"DWORD" => "uint32",
+ "uint" => "uint32",
"int" => "int32",
"WORD" => "uint16",
"char" => "uint8",
diff --git a/source4/scripting/python/modules.c b/source4/scripting/python/modules.c
index 8c5115efca..1728f166bd 100644
--- a/source4/scripting/python/modules.c
+++ b/source4/scripting/python/modules.c
@@ -42,6 +42,8 @@ static void initdcerpc_misc(void) {}
extern void initmgmt(void);
extern void initatsvc(void);
extern void initsamr(void);
+extern void initsecurity(void);
+extern void initlsa(void);
static struct _inittab py_modules[] = { STATIC_LIBPYTHON_MODULES };