s3-param: Move the options needed for running smbd in the AD DC to loadparm
[sfrench/samba-autobuild/.git] / file_server / file_server.c
index b78495dd015a8563352fb8b95c782635bb30219e..430782c60324563e67e41706fa3a8f734efe0358 100644 (file)
 #include "file_server/file_server.h"
 #include "dynconfig.h"
 
-/*
-  generate a smbd config file for the file server
- */
-static const char *generate_smb_conf(struct task_server *task)
-{
-       int fd;
-       struct loadparm_context *lp_ctx = task->lp_ctx;
-       const char *path = smbd_tmp_path(task, lp_ctx, "fileserver.conf");
-
-       if (path == NULL) {
-               return NULL;
-       }
-
-       fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, 0644);
-       if (fd == -1) {
-               DEBUG(0,("Failed to create %s", path));
-               return NULL;
-       }
-
-       fdprintf(fd, "[globals]\n");
-       fdprintf(fd, "# auto-generated config for fileserver\n");
-       fdprintf(fd, "server role check:inhibit=yes\n");
-        fdprintf(fd, "rpc_server:default = external\n");
-       fdprintf(fd, "rpc_server:svcctl = embedded\n");
-       fdprintf(fd, "rpc_server:srvsvc = embedded\n");
-       fdprintf(fd, "rpc_server:eventlog = embedded\n");
-       fdprintf(fd, "rpc_server:ntsvcs = embedded\n");
-       fdprintf(fd, "rpc_server:winreg = embedded\n");
-       fdprintf(fd, "rpc_server:spoolss = embedded\n");
-       fdprintf(fd, "rpc_daemon:spoolssd = embedded\n");
-       fdprintf(fd, "rpc_server:tcpip = no\n");
-
-       fdprintf(fd, "map hidden = no\n");
-       fdprintf(fd, "map system = no\n");
-       fdprintf(fd, "map readonly = no\n");
-       fdprintf(fd, "store dos attributes = yes\n");
-       fdprintf(fd, "create mask = 0777\n");
-       fdprintf(fd, "directory mask = 0777\n");
-
-       fdprintf(fd, "include = %s\n", lpcfg_configfile(lp_ctx));
-
-       close(fd);
-       return path;
-}
-
 /*
   called if smbd exits
  */
@@ -100,23 +55,19 @@ static void file_server_smbd_done(struct tevent_req *subreq)
 */
 static void s3fs_task_init(struct task_server *task)
 {
-       const char *fileserver_conf;
        struct tevent_req *subreq;
        const char *smbd_path;
        const char *smbd_cmd[2] = { NULL, NULL };
 
        task_server_set_title(task, "task[s3fs_parent]");
 
-       /* create a smb.conf for smbd to use */
-       fileserver_conf = generate_smb_conf(task);
-
        smbd_path = talloc_asprintf(task, "%s/smbd", dyn_SBINDIR);
        smbd_cmd[0] = smbd_path;
 
        /* start it as a child process */
        subreq = samba_runcmd_send(task, task->event_ctx, timeval_zero(), 1, 0,
                                smbd_cmd,
-                               "--configfile", fileserver_conf,
+                               "--option=server role check:inhibit=yes",
                                "--foreground",
                                debug_get_output_is_stdout()?"--log-stdout":NULL,
                                NULL);
@@ -128,7 +79,7 @@ static void s3fs_task_init(struct task_server *task)
 
        tevent_req_set_callback(subreq, file_server_smbd_done, task);
 
-       DEBUG(1,("Started file server smbd with config %s\n", fileserver_conf));
+       DEBUG(5,("Started file server child smbd\n"));
 }
 
 /* called at smbd startup - register ourselves as a server service */