diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-02 22:32:11 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:47:15 +0100 |
commit | 6c999cd12344f2bb8b1d2941210b4c205b3e0aad (patch) | |
tree | 0911e4ca75694e080173c2863e2c41ff5881309c /source4/smbd | |
parent | 934e932387ea5668ec000bcefe4ec86935297339 (diff) | |
download | samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.tar.gz samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.tar.xz samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.zip |
r26236: Remove more uses of global_loadparm or specify loadparm_context explicitly.
(This used to be commit 5b29ef7c03d9ae76b0ca909e9f03a58e1bad3521)
Diffstat (limited to 'source4/smbd')
-rw-r--r-- | source4/smbd/pidfile.c | 10 | ||||
-rw-r--r-- | source4/smbd/process_model.c | 4 | ||||
-rw-r--r-- | source4/smbd/server.c | 14 |
3 files changed, 14 insertions, 14 deletions
diff --git a/source4/smbd/pidfile.c b/source4/smbd/pidfile.c index 4847ddd7b52..3567846070a 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 bb4d3a53bbf..e240ae2c609 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 5dac250ee85..65196618db9 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"); |