summaryrefslogtreecommitdiff
path: root/source4/scripting/ejs/smbcalls_auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting/ejs/smbcalls_auth.c')
-rw-r--r--source4/scripting/ejs/smbcalls_auth.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c
index 568b24713c..678d3c6a7f 100644
--- a/source4/scripting/ejs/smbcalls_auth.c
+++ b/source4/scripting/ejs/smbcalls_auth.c
@@ -39,8 +39,17 @@ static int ejs_doauth(MprVarHandle eid,
struct MprVar *session_info_obj;
NTSTATUS nt_status;
- /* Hope we can find the event context somewhere up there... */
- struct event_context *ev = event_context_find(tmp_ctx);
+ struct smbcalls_context *c;
+ struct event_context *ev;
+
+ /* Hope we can find an smbcalls_context somewhere up there... */
+ c = talloc_find_parent_bytype(tmp_ctx, struct smbcalls_context);
+ if (c) {
+ ev = c->event_ctx;
+ } else {
+ /* Hope we can find the event context somewhere up there... */
+ ev = event_context_find(tmp_ctx);
+ }
nt_status = auth_context_create(tmp_ctx, auth_types, &auth_context, ev);
if (!NT_STATUS_IS_OK(nt_status)) {