summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-07 08:32:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:19 -0500
commit65ddc6e9b93f5e0527febe1c6bb9dd7f9355530e (patch)
treeebd2b7fd46501a5e1f6f3499297dc60f38686254
parent5eea409d4c57aba091a7ed8d8304627c9796f873 (diff)
downloadsamba-65ddc6e9b93f5e0527febe1c6bb9dd7f9355530e.tar.gz
samba-65ddc6e9b93f5e0527febe1c6bb9dd7f9355530e.tar.bz2
samba-65ddc6e9b93f5e0527febe1c6bb9dd7f9355530e.zip
r8200: - added stub functions for union pull/push
- kill the js interpreter with an exception on internal errors (This used to be commit 5f062d71481a0aa2d8c89099abb2d171b789879e)
-rw-r--r--source4/build/pidl/ejs.pm37
-rw-r--r--source4/scripting/ejs/smbcalls_rpc.c3
2 files changed, 34 insertions, 6 deletions
diff --git a/source4/build/pidl/ejs.pm b/source4/build/pidl/ejs.pm
index bd35078abd..8c35da4f2e 100644
--- a/source4/build/pidl/ejs.pm
+++ b/source4/build/pidl/ejs.pm
@@ -159,6 +159,18 @@ sub EjsStructPull($$)
}
###########################
+# pull a union
+sub EjsUnionPull($$)
+{
+ my $name = shift;
+ my $d = shift;
+ my $env = GenerateStructEnv($d);
+ pidl "\nstatic NTSTATUS ejs_pull_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, union $name *r)\n{\n";
+ pidl "return ejs_panic(ejs, \"union pull not handled\");\n";
+ pidl "}\n\n";
+}
+
+###########################
# pull a enum
sub EjsEnumPull($$)
{
@@ -178,8 +190,15 @@ sub EjsEnumPull($$)
sub EjsTypedefPull($)
{
my $d = shift;
- $d->{DATA}->{TYPE} eq 'STRUCT' && EjsStructPull($d->{NAME}, $d->{DATA});
- $d->{DATA}->{TYPE} eq 'ENUM' && EjsEnumPull($d->{NAME}, $d->{DATA});
+ if ($d->{DATA}->{TYPE} eq 'STRUCT') {
+ EjsStructPull($d->{NAME}, $d->{DATA});
+ } elsif ($d->{DATA}->{TYPE} eq 'UNION') {
+ EjsUnionPull($d->{NAME}, $d->{DATA});
+ } elsif ($d->{DATA}->{TYPE} eq 'ENUM') {
+ EjsEnumPull($d->{NAME}, $d->{DATA});
+ } else {
+ die "Unhandled pull typedef $d->{NAME} of type $d->{TYPE}\n";
+ }
}
#####################
@@ -306,7 +325,7 @@ sub EjsUnionPush($$)
my $name = shift;
my $d = shift;
pidl "\nstatic NTSTATUS ejs_push_$name(struct ejs_rpc *ejs, struct MprVar *v, const char *name, const union $name *r)\n{\n";
- pidl "\treturn NT_STATUS_OK;\n";
+ pidl "return ejs_panic(ejs, \"union push not handled\");\n";
pidl "}\n\n";
}
@@ -329,9 +348,15 @@ sub EjsEnumPush($$)
sub EjsTypedefPush($)
{
my $d = shift;
- $d->{DATA}->{TYPE} eq 'STRUCT' && EjsStructPush($d->{NAME}, $d->{DATA});
- $d->{DATA}->{TYPE} eq 'UNION' && EjsUnionPush($d->{NAME}, $d->{DATA});
- $d->{DATA}->{TYPE} eq 'ENUM' && EjsEnumPush($d->{NAME}, $d->{DATA});
+ if ($d->{DATA}->{TYPE} eq 'STRUCT') {
+ EjsStructPush($d->{NAME}, $d->{DATA});
+ } elsif ($d->{DATA}->{TYPE} eq 'UNION') {
+ EjsUnionPush($d->{NAME}, $d->{DATA});
+ } elsif ($d->{DATA}->{TYPE} eq 'ENUM') {
+ EjsEnumPush($d->{NAME}, $d->{DATA});
+ } else {
+ die "Unhandled push typedef $d->{NAME} of type $d->{TYPE}\n";
+ }
}
diff --git a/source4/scripting/ejs/smbcalls_rpc.c b/source4/scripting/ejs/smbcalls_rpc.c
index 00675165ea..6ec3e29e50 100644
--- a/source4/scripting/ejs/smbcalls_rpc.c
+++ b/source4/scripting/ejs/smbcalls_rpc.c
@@ -157,6 +157,9 @@ done:
talloc_free(ptr);
done:
ejsSetReturnValue(eid, mprNTSTATUS(status));
+ if (NT_STATUS_EQUAL(status, NT_STATUS_INTERNAL_ERROR)) {
+ return -1;
+ }
return 0;
}