summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testprogs/ejs/ldb.js24
-rw-r--r--testprogs/ejs/loadparm.js19
2 files changed, 43 insertions, 0 deletions
diff --git a/testprogs/ejs/ldb.js b/testprogs/ejs/ldb.js
new file mode 100644
index 0000000000..7675197904
--- /dev/null
+++ b/testprogs/ejs/ldb.js
@@ -0,0 +1,24 @@
+/*
+ demonstrate access to ldb databases from ejs
+*/
+
+println("Trying a attribute constrained search on samdb");
+
+var dbfile = lpGet("sam database");
+var attrs = new Array("name", "dnsDomain", "objectSid", "dn");
+
+res = ldbSearch(dbfile, "(objectClass=domain)", attrs);
+
+printVars(res);
+
+println("and now an unconstrained search");
+
+var dbfile = lpGet("sam database");
+res = ldbSearch(dbfile, "(objectClass=user)");
+printVars(res);
+
+println("and a bad search");
+
+res = ldbSearch("foo");
+
+println("all done");
diff --git a/testprogs/ejs/loadparm.js b/testprogs/ejs/loadparm.js
new file mode 100644
index 0000000000..fdeaed9d34
--- /dev/null
+++ b/testprogs/ejs/loadparm.js
@@ -0,0 +1,19 @@
+/*
+ demonstrate access to loadparm functions from ejs
+*/
+
+print("defined services: ");
+printVars(lpServices());
+
+function showParameter(name) {
+ print(name + ": ");
+ printVars(lpGet(name));
+}
+
+showParameter("server services");
+showParameter("netbios name");
+showParameter("security");
+showParameter("workgroup");
+showParameter("log level");
+showParameter("server signing");
+showParameter("interfaces");