summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/pidfile.c10
-rw-r--r--source4/smbd/process_model.c4
-rw-r--r--source4/smbd/server.c14
3 files changed, 14 insertions, 14 deletions
diff --git a/source4/smbd/pidfile.c b/source4/smbd/pidfile.c
index 4847ddd7b5..3567846070 100644
--- a/source4/smbd/pidfile.c
+++ b/source4/smbd/pidfile.c
@@ -33,14 +33,14 @@
* return the pid in a pidfile. return 0 if the process (or pidfile)
* does not exist
*/
-pid_t pidfile_pid(const char *name)
+pid_t pidfile_pid(const char *piddir, const char *name)
{
int fd;
char pidstr[20];
pid_t ret;
char *pidFile;
- asprintf(&pidFile, "%s/%s.pid", lp_piddir(global_loadparm), name);
+ asprintf(&pidFile, "%s/%s.pid", piddir, name);
fd = open(pidFile, O_NONBLOCK | O_RDONLY, 0644);
@@ -80,16 +80,16 @@ pid_t pidfile_pid(const char *name)
/**
* create a pid file in the pid directory. open it and leave it locked
*/
-void pidfile_create(const char *name)
+void pidfile_create(const char *piddir, const char *name)
{
int fd;
char buf[20];
char *pidFile;
pid_t pid;
- asprintf(&pidFile, "%s/%s.pid", lp_piddir(global_loadparm), name);
+ asprintf(&pidFile, "%s/%s.pid", piddir, name);
- pid = pidfile_pid(name);
+ pid = pidfile_pid(piddir, name);
if (pid != 0) {
DEBUG(0,("ERROR: %s is already running. File %s exists and process id %d is running.\n",
name, pidFile, (int)pid));
diff --git a/source4/smbd/process_model.c b/source4/smbd/process_model.c
index bb4d3a53bb..e240ae2c60 100644
--- a/source4/smbd/process_model.c
+++ b/source4/smbd/process_model.c
@@ -80,10 +80,10 @@ _PUBLIC_ NTSTATUS register_process_model(const void *_ops)
return NT_STATUS_OK;
}
-NTSTATUS process_model_init(void)
+NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
{
init_module_fn static_init[] = STATIC_process_model_MODULES;
- init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "process_model");
+ init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "process_model");
run_init_functions(static_init);
run_init_functions(shared_init);
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 5dac250ee8..65196618db 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -88,12 +88,12 @@ static void recursive_delete(const char *path)
range locking system. So instead of putting the burden on tdb to
cleanup tmp files, this function deletes them.
*/
-static void cleanup_tmp_files(void)
+static void cleanup_tmp_files(struct loadparm_context *lp_ctx)
{
char *path;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
- path = smbd_tmp_path(mem_ctx, global_loadparm, NULL);
+ path = smbd_tmp_path(mem_ctx, lp_ctx, NULL);
recursive_delete(path);
talloc_free(mem_ctx);
@@ -267,13 +267,13 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
become_daemon(true);
}
- cleanup_tmp_files();
+ cleanup_tmp_files(global_loadparm);
if (!directory_exist(lp_lockdir(global_loadparm))) {
mkdir(lp_lockdir(global_loadparm), 0755);
}
- pidfile_create(binary_name);
+ pidfile_create(lp_piddir(global_loadparm), binary_name);
/* Do *not* remove this, until you have removed
* passdb/secrets.c, and proved that Samba still builds... */
@@ -284,17 +284,17 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
ldb_global_init(); /* FIXME: */
- share_init();
+ share_init(global_loadparm);
gensec_init(global_loadparm); /* FIXME: */
- ntptr_init(); /* FIXME: maybe run this in the initialization function
+ ntptr_init(global_loadparm); /* FIXME: maybe run this in the initialization function
of the spoolss RPC server instead? */
ntvfs_init(); /* FIXME: maybe run this in the initialization functions
of the SMB[,2] server instead? */
- process_model_init();
+ process_model_init(global_loadparm);
shared_init = load_samba_modules(NULL, global_loadparm, "service");