s3:winbind: Pass the 'samba' daemon config file to winbindd
authorAndreas Schneider <asn@samba.org>
Mon, 11 Jan 2021 15:30:44 +0000 (16:30 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 28 Apr 2021 03:43:34 +0000 (03:43 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/winbind/winbindd.c

index 0811d13fa1a6678b8ac5d1e55fc171e5b829d620..5a74db66159d4c38c83b23a9e17271cc1b363c26 100644 (file)
@@ -59,6 +59,7 @@ static NTSTATUS winbindd_task_init(struct task_server *task)
        struct tevent_req *subreq;
        const char *winbindd_path;
        const char *winbindd_cmd[2] = { NULL, NULL };
+       const char *config_file = "";
 
        task_server_set_title(task, "task[winbindd_parent]");
 
@@ -68,12 +69,22 @@ static NTSTATUS winbindd_task_init(struct task_server *task)
        }
        winbindd_cmd[0] = winbindd_path;
 
+       if (!is_default_dyn_CONFIGFILE()) {
+               config_file = talloc_asprintf(task,
+                                             "--configfile=%s",
+                                             get_dyn_CONFIGFILE());
+               if (config_file == NULL) {
+                       return NT_STATUS_NO_MEMORY;
+               }
+       }
+
        /* start it as a child process */
        subreq = samba_runcmd_send(task, task->event_ctx, timeval_zero(), 1, 0,
                                winbindd_cmd,
                                "-D",
                                "--option=server role check:inhibit=yes",
                                "--foreground",
+                               config_file,
                                debug_get_output_is_stdout()?"--stdout":NULL,
                                NULL);
        if (subreq == NULL) {