file_server: Pass the 'samba' daemon config file to smbd
authorAndreas Schneider <asn@samba.org>
Mon, 11 Jan 2021 15:24:23 +0000 (16:24 +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>
file_server/file_server.c

index 91c3147734c9b138f2d03bc578249f4255d25997..b55f13f5687632e3584437223a1411fbd1abfd6c 100644 (file)
@@ -58,6 +58,7 @@ static NTSTATUS s3fs_task_init(struct task_server *task)
        struct tevent_req *subreq;
        const char *smbd_path;
        const char *smbd_cmd[2] = { NULL, NULL };
+       const char *config_file = "";
 
        task_server_set_title(task, "task[s3fs_parent]");
 
@@ -67,6 +68,15 @@ static NTSTATUS s3fs_task_init(struct task_server *task)
        }
        smbd_cmd[0] = smbd_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;
+               }
+       }
+
        /* the child should be able to call through nss_winbind */
        (void)winbind_on();
        /* start it as a child process */
@@ -75,6 +85,7 @@ static NTSTATUS s3fs_task_init(struct task_server *task)
                                "-D",
                                "--option=server role check:inhibit=yes",
                                "--foreground",
+                               config_file,
                                debug_get_output_is_stdout()?"--log-stdout":NULL,
                                NULL);
        /* the parent should not be able to call through nss_winbind */