From a8eec313549905724a8186a1a4c14480658e2967 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Jan 2006 21:04:32 +0000 Subject: r12746: An initial version of the kludge_acls module. This should be replaced with real ACLs, which tridge is working on. In the meantime, the rules are very simple: - SYSTEM and Administrators can read all. - Users and anonymous cannot read passwords, can read everything else - list of 'password' attributes is hard-coded Most of the difficult work in this was fighting with the C/js interface to add a system_session() all, as it still doesn't get on with me :-) Andrew Bartlett (This used to be commit be9d0cae8989429ef47a713d8f0a82f12966fc78) --- source4/scripting/ejs/smbcalls_ldb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source4/scripting/ejs/smbcalls_ldb.c') diff --git a/source4/scripting/ejs/smbcalls_ldb.c b/source4/scripting/ejs/smbcalls_ldb.c index 798747b36c..39698947d7 100644 --- a/source4/scripting/ejs/smbcalls_ldb.c +++ b/source4/scripting/ejs/smbcalls_ldb.c @@ -385,9 +385,9 @@ static int ejs_ldbModify(MprVarHandle eid, int argc, struct MprVar **argv) static int ejs_ldbConnect(MprVarHandle eid, int argc, char **argv) { struct ldb_context *ldb; - struct auth_session_info *session_info; + struct auth_session_info *session_info = NULL; struct cli_credentials *creds = NULL; - struct MprVar *credentials; + struct MprVar *credentials, *session; struct MprVar *this = mprGetProperty(ejsGetLocalObject(eid), "this", 0); const char *dbfile; @@ -397,13 +397,16 @@ static int ejs_ldbConnect(MprVarHandle eid, int argc, char **argv) return -1; } - session_info = mprGetThisPtr(eid, "session_info"); - credentials = mprGetProperty(this, "credentials", NULL); if (credentials) { creds = mprGetPtr(credentials, "creds"); } + session = mprGetProperty(this, "session_info", NULL); + if (session) { + session_info = mprGetPtr(session, "session_info"); + } + dbfile = argv[0]; ldb = ldb_wrap_connect(mprMemCtx(), dbfile, -- cgit