[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Thu Nov 1 04:48:02 MDT 2012


The branch, master has been updated
       via  75c51d6 s3-param: Move the options needed for running smbd in the AD DC to loadparm
       via  fc5caff file_server: put set create mask and directory mask in fileserver.conf
      from  dd60dcf test-chgdcpass: test the ldap case for server password change

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 75c51d6561f6f39dd02fd942709039b871957f44
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Nov 1 11:26:16 2012 +1100

    s3-param: Move the options needed for running smbd in the AD DC to loadparm
    
    This avoids the whole fileserver.conf thing, and simply handles everything in C.
    
    The main challenge is that if s3fs is enabled in a member server
    configuration (unlikely) then these options will not be set, and it
    overrides any other attempt to set these as globals.  (The previous
    approach essentially just changed defaults, because the include =
    of smb.conf was after the values were set in fileserver.conf).
    
    Andrew Bartlett
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Thu Nov  1 11:47:22 CET 2012 on sn-devel-104

commit fc5caffbc139d63cab1ec105884863f73772586f
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Thu Nov 1 11:24:00 2012 +1100

    file_server: put set create mask and directory mask in fileserver.conf
    
    This allows any ACL to be set from the client, without restriction
    from the Samba side.
    
    Based on advise from Jermey at https://lists.samba.org/archive/samba-technical/2012-October/088414.html
    
    Andrew Bartlett
    
    Signed-off-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 file_server/file_server.c |   51 +-------------------------------------------
 source3/param/loadparm.c  |   17 +++++++++++++++
 2 files changed, 19 insertions(+), 49 deletions(-)


Changeset truncated at 500 lines:

diff --git a/file_server/file_server.c b/file_server/file_server.c
index 0777de5..430782c 100644
--- a/file_server/file_server.c
+++ b/file_server/file_server.c
@@ -30,49 +30,6 @@
 #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, "include = %s\n", lpcfg_configfile(lp_ctx));
-
-	close(fd);
-	return path;
-}
-
-/*
   called if smbd exits
  */
 static void file_server_smbd_done(struct tevent_req *subreq)
@@ -98,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);
@@ -126,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 */
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 42bf11d..12cb8db 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4899,6 +4899,23 @@ static bool lp_load_ex(const char *pszFname,
 			}
 		}
 		lp_do_parameter(-1, "passdb backend", "samba_dsdb");
+
+		lp_do_parameter(-1, "rpc_server:default", "external");
+		lp_do_parameter(-1, "rpc_server:svcctl", "embedded");
+		lp_do_parameter(-1, "rpc_server:srvsvc", "embedded");
+		lp_do_parameter(-1, "rpc_server:eventlog", "embedded");
+		lp_do_parameter(-1, "rpc_server:ntsvcs", "embedded");
+		lp_do_parameter(-1, "rpc_server:winreg", "embedded");
+		lp_do_parameter(-1, "rpc_server:spoolss", "embedded");
+		lp_do_parameter(-1, "rpc_daemon:spoolssd", "embedded");
+		lp_do_parameter(-1, "rpc_server:tcpip", "no");
+
+		lp_do_parameter(-1, "map hidden", "no");
+		lp_do_parameter(-1, "map system", "no");
+		lp_do_parameter(-1, "map readonly", "no");
+		lp_do_parameter(-1, "store dos attributes", "yes");
+		lp_do_parameter(-1, "create mask", "0777");
+		lp_do_parameter(-1, "directory mask", "0777");
 	}
 
 	bAllowIncludeRegistry = true;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list