s4:s3compat Provide a hook to get at the Samba4 loadparm from Samba3
authorAndrew Bartlett <abartlet@samba.org>
Tue, 4 May 2010 09:13:08 +0000 (19:13 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 01:12:32 +0000 (11:12 +1000)
The idea here is that we can provide here functions to make it
possible to hook the Samba4 context-provided loadparm into Samba3's
loadparm callers.

Andrew Bartlett

source4/s3compat/s3_smbd.c
source4/s3compat/s3replace.c

index 65f9ab6cc0cc00b1dc3565a84d2ce5d4d977905c..caf66761c4cc3e20f5dc7966fb56c7d7521053c5 100644 (file)
@@ -46,6 +46,8 @@ static void s3compat_smb_accept(struct stream_connection *conn)
                sleep(2);
        }
        DEBUG(0,(__location__ ": new s3compat smbd connection\n"));
+       s3replace_set_lp_ctx(conn->lp_ctx);
+
        s3compat_set_server_fd(fd);
        s3compat_set_event_ctx(conn->event.ctx);
        tevent_re_initialise(conn->event.ctx);
@@ -92,7 +94,7 @@ _PUBLIC_ void s3_smbd_task_init(struct task_server *task)
 {
        NTSTATUS status;
        const struct model_ops *model_ops;
-
+       
        model_ops = process_model_startup(task->event_ctx, "standard");
 
        if (model_ops == NULL) {
index 16526ec6d4dd0c1b7bfcd5a510df08df14ccb968..80b0e266e2d03b1b9ea20ee81e0fa4a3856798e3 100644 (file)
@@ -40,3 +40,15 @@ krb5_realm *krb5_princ_realm(krb5_context context, krb5_principal principal)
 {
        DEBUG(2,("WARNING: krb5_princ_set_realm not implemented in s3replace\n"));
 }
+
+static struct loadparm_context *s3replace_lp_ctx;
+
+void s3replace_set_lp_ctx(struct loadparm_context *lp_ctx)
+{
+       s3replace_lp_ctx = lp_ctx;
+}
+
+struct loadparm_context *s3replace_get_lp_ctx(void)
+{
+       return s3replace_lp_ctx;
+}