diff options
author | Garming Sam <garming@catalyst.net.nz> | 2014-03-27 15:03:37 +1300 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-07-31 08:17:11 +0200 |
commit | 397a3ece0bcb0b932817643878dcd669668d31ec (patch) | |
tree | 280a6e47aa508b700999cad4cc5ffd53557193d4 /source3/param | |
parent | 308d802f62839c7df27fd6384f33e36f4273f02a (diff) | |
download | samba-397a3ece0bcb0b932817643878dcd669668d31ec.tar.gz samba-397a3ece0bcb0b932817643878dcd669668d31ec.tar.xz samba-397a3ece0bcb0b932817643878dcd669668d31ec.zip |
param: change init_printer_values to take an lp ctx
Change-Id: I55cda94bbf1daf276ec0c45b056bd81645eaa25f
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 3410735975..8148db67c5 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -310,7 +310,8 @@ bool lp_string_set(char **dest, const char *src) { Initialise the sDefault parameter structure for the printer values. ***************************************************************************/ -void init_printer_values(TALLOC_CTX *ctx, struct loadparm_service *pService) +void init_printer_values(struct loadparm_context *lp_ctx, TALLOC_CTX *ctx, + struct loadparm_service *pService) { /* choose defaults depending on the type of printing */ switch (pService->printing) { @@ -372,12 +373,14 @@ void init_printer_values(TALLOC_CTX *ctx, struct loadparm_service *pService) case PRINT_VLP: { const char *tdbfile; TALLOC_CTX *tmp_ctx = talloc_new(ctx); - char *tmp; + const char *tmp; - tdbfile = talloc_asprintf( - tmp_ctx, "tdbfile=%s", - lp_parm_const_string(-1, "vlp", "tdbfile", - "/tmp/vlp.tdb")); + tmp = lpcfg_parm_string(lp_ctx, NULL, "vlp", "tdbfile"); + if (tmp == NULL) { + tmp = "/tmp/vlp.tdb"; + } + + tdbfile = talloc_asprintf(tmp_ctx, "tdbfile=%s", tmp); if (tdbfile == NULL) { tdbfile="tdbfile=/tmp/vlp.tdb"; } @@ -678,7 +681,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals) string_set(Globals.ctx, &sDefault.fstype, FSTYPE_STRING); string_set(Globals.ctx, &sDefault.printjob_username, "%U"); - init_printer_values(Globals.ctx, &sDefault); + init_printer_values(lp_ctx, Globals.ctx, &sDefault); sDefault.ntvfs_handler = (const char **)str_list_make_v3(NULL, "unixuid default", NULL); |