summaryrefslogtreecommitdiff
path: root/source4/scripting/libjs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-15 07:18:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:23:08 -0500
commita0bc4da1a307753e3b28a11863f50d66b0894190 (patch)
treed16430b5a02dd01188c7aa1722181eb947ec9442 /source4/scripting/libjs
parent7b8332369f3664af13bd7760561765a35c312b9e (diff)
downloadsamba-a0bc4da1a307753e3b28a11863f50d66b0894190.tar.gz
samba-a0bc4da1a307753e3b28a11863f50d66b0894190.tar.bz2
samba-a0bc4da1a307753e3b28a11863f50d66b0894190.zip
r8483: switched our generated ejs rpc code over to the new OO interface. This
means we don't pollute the name space, and also makes for faster startup times as we only create variables for the pipes that we use, not all pipes (This used to be commit 57d7a585e8162d21c7152952aa0cc7471968784f)
Diffstat (limited to 'source4/scripting/libjs')
-rw-r--r--source4/scripting/libjs/samr.js29
1 files changed, 15 insertions, 14 deletions
diff --git a/source4/scripting/libjs/samr.js b/source4/scripting/libjs/samr.js
index a1f79b541a..2363dde686 100644
--- a/source4/scripting/libjs/samr.js
+++ b/source4/scripting/libjs/samr.js
@@ -18,7 +18,7 @@ function samArray(output)
if (output.sam == NULL) {
return list;
}
- var entries = output.sam.entries;
+ var i, entries = output.sam.entries;
for (i=0;i<output.num_entries;i++) {
list[i] = new Object();
list[i].name = entries[i].name;
@@ -32,10 +32,12 @@ function samArray(output)
*/
function samrConnect(conn)
{
+ conn.samr = samr_init();
+ conn.sec = security_init();
var io = irpcObj();
io.input.system_name = NULL;
- io.input.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
- status = dcerpc_samr_Connect(conn, io);
+ io.input.access_mask = conn.sec.SEC_FLAG_MAXIMUM_ALLOWED;
+ var status = conn.samr.samr_Connect2(conn, io);
check_status_ok(status);
return io.output.connect_handle;
}
@@ -47,7 +49,7 @@ function samrClose(conn, handle)
{
var io = irpcObj();
io.input.handle = handle;
- status = dcerpc_samr_Close(conn, io);
+ var status = conn.samr.samr_Close(conn, io);
check_status_ok(status);
}
@@ -59,7 +61,7 @@ function samrLookupDomain(conn, handle, domain)
var io = irpcObj();
io.input.connect_handle = handle;
io.input.domain_name = domain;
- status = dcerpc_samr_LookupDomain(conn, io);
+ var status = conn.samr.samr_LookupDomain(conn, io);
check_status_ok(status);
return io.output.sid;
}
@@ -71,9 +73,9 @@ function samrOpenDomain(conn, handle, sid)
{
var io = irpcObj();
io.input.connect_handle = handle;
- io.input.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+ io.input.access_mask = conn.sec.SEC_FLAG_MAXIMUM_ALLOWED;
io.input.sid = sid;
- status = dcerpc_samr_OpenDomain(conn, io);
+ var status = conn.samr.samr_OpenDomain(conn, io);
check_status_ok(status);
return io.output.domain_handle;
}
@@ -85,9 +87,9 @@ function samrOpenUser(conn, handle, rid)
{
var io = irpcObj();
io.input.domain_handle = handle;
- io.input.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+ io.input.access_mask = conn.sec.SEC_FLAG_MAXIMUM_ALLOWED;
io.input.rid = rid;
- status = dcerpc_samr_OpenUser(conn, io);
+ var status = conn.samr.samr_OpenUser(conn, io);
check_status_ok(status);
return io.output.user_handle;
}
@@ -102,7 +104,7 @@ function samrEnumDomainUsers(conn, dom_handle)
io.input.resume_handle = 0;
io.input.acct_flags = 0;
io.input.max_size = -1;
- status = dcerpc_samr_EnumDomainUsers(conn, io);
+ var status = conn.samr.samr_EnumDomainUsers(conn, io);
check_status_ok(status);
return samArray(io.output);
}
@@ -117,7 +119,7 @@ function samrEnumDomainGroups(conn, dom_handle)
io.input.resume_handle = 0;
io.input.acct_flags = 0;
io.input.max_size = -1;
- status = dcerpc_samr_EnumDomainGroups(conn, io);
+ var status = conn.samr.samr_EnumDomainGroups(conn, io);
check_status_ok(status);
return samArray(io.output);
}
@@ -131,7 +133,7 @@ function samrEnumDomains(conn, handle)
io.input.connect_handle = handle;
io.input.resume_handle = 0;
io.input.buf_size = -1;
- status = dcerpc_samr_EnumDomains(conn, io);
+ var status = conn.samr.samr_EnumDomains(conn, io);
check_status_ok(status);
return samArray(io.output);
}
@@ -144,7 +146,7 @@ function samrQueryUserInfo(conn, user_handle, level)
var r, io = irpcObj();
io.input.user_handle = user_handle;
io.input.level = level;
- status = dcerpc_samr_QueryUserInfo(conn, io);
+ var status = conn.samr.samr_QueryUserInfo(conn, io);
check_status_ok(status);
return io.output.info.info3;
}
@@ -167,4 +169,3 @@ function samrFillUserInfo(conn, dom_handle, users, level)
}
}
-