summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs/ejsrpc.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-09 05:28:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:26 -0500
commit7efeb8f451345b54ce125bcbb601ba2475ef9e59 (patch)
treec271dd1897070b31b2f7dcc977dd8ead73dab6e2 /source4/scripting/ejs/ejsrpc.c
parent8ca17e2f47cb171d615784b2449106135e27f1c2 (diff)
downloadsamba-7efeb8f451345b54ce125bcbb601ba2475ef9e59.tar.gz
samba-7efeb8f451345b54ce125bcbb601ba2475ef9e59.tar.bz2
samba-7efeb8f451345b54ce125bcbb601ba2475ef9e59.zip
r8256: - allow rpc calls from non-command line ejs contexts by creating a set
of null credentials to use if cmdline_credentials is not setup - hide the length and size elements of a lsa_String from js scripts, so you can use a lsa_String just as an ordinary string without knowing its a structure. We won't do this with all structures, just a few core ones that are used often enough to warrant it. - make sure returned ldb arrays have a length property (This used to be commit 12d2092dd8668de41776132ccbcd634790c371a9)
Diffstat (limited to 'source4/scripting/ejs/ejsrpc.c')
-rw-r--r--source4/scripting/ejs/ejsrpc.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/source4/scripting/ejs/ejsrpc.c b/source4/scripting/ejs/ejsrpc.c
index 992defe8bb..32728ebfe4 100644
--- a/source4/scripting/ejs/ejsrpc.c
+++ b/source4/scripting/ejs/ejsrpc.c
@@ -22,8 +22,9 @@
#include "includes.h"
#include "lib/ejs/ejs.h"
-#include "scripting/ejs/ejsrpc.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
+#include "scripting/ejs/ejsrpc.h"
NTSTATUS ejs_pull_rpc(int eid, const char *callname,
struct MprVar *v, void *ptr, ejs_pull_function_t ejs_pull)
@@ -423,3 +424,21 @@ BOOL ejs_pull_null(struct ejs_rpc *ejs, struct MprVar *v, const char *name)
}
return False;
}
+
+/*
+ pull a lsa_String
+*/
+NTSTATUS ejs_pull_lsa_String(struct ejs_rpc *ejs,
+ struct MprVar *v, const char *name, struct lsa_String *r)
+{
+ return ejs_pull_string(ejs, v, name, &r->string);
+}
+
+/*
+ push a lsa_String
+*/
+NTSTATUS ejs_push_lsa_String(struct ejs_rpc *ejs,
+ struct MprVar *v, const char *name, const struct lsa_String *r)
+{
+ return ejs_push_string(ejs, v, name, r->string);
+}