From fe35ff2bf98c166b2f3bfbaa171a58727e1ba091 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 2 Apr 2011 18:51:55 +0200 Subject: s3: Make vlp printing work by default Autobuild-User: Volker Lendecke Autobuild-Date: Tue Apr 5 13:12:14 CEST 2011 on sn-devel-104 --- source3/param/loadparm.c | 63 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 172e5c446a..0f76f0925a 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -4864,15 +4864,62 @@ static void init_printer_values(struct service *pService) #if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS) case PRINT_TEST: - case PRINT_VLP: - string_set(&pService->szPrintcommand, "vlp print %p %s"); - string_set(&pService->szLpqcommand, "vlp lpq %p"); - string_set(&pService->szLprmcommand, "vlp lprm %p %j"); - string_set(&pService->szLppausecommand, "vlp lppause %p %j"); - string_set(&pService->szLpresumecommand, "vlp lpresume %p %j"); - string_set(&pService->szQueuepausecommand, "vlp queuepause %p"); - string_set(&pService->szQueueresumecommand, "vlp queueresume %p"); + case PRINT_VLP: { + const char *tdbfile; + char *tmp; + + tdbfile = talloc_asprintf( + talloc_tos(), "tdbfile=%s", + lp_parm_const_string(-1, "vlp", "tdbfile", + "/tmp/vlp.tdb")); + if (tdbfile == NULL) { + tdbfile="tdbfile=/tmp/vlp.tdb"; + } + + tmp = talloc_asprintf(talloc_tos(), "vlp %s print %%p %%s", + tdbfile); + string_set(&pService->szPrintcommand, + tmp ? tmp : "vlp print %p %s"); + TALLOC_FREE(tmp); + + tmp = talloc_asprintf(talloc_tos(), "vlp %s lpq %%p", + tdbfile); + string_set(&pService->szLpqcommand, + tmp ? tmp : "vlp lpq %p"); + TALLOC_FREE(tmp); + + tmp = talloc_asprintf(talloc_tos(), "vlp %s lprm %%p %%j", + tdbfile); + string_set(&pService->szLprmcommand, + tmp ? tmp : "vlp lprm %p %j"); + TALLOC_FREE(tmp); + + tmp = talloc_asprintf(talloc_tos(), "vlp %s lppause %%p %%j", + tdbfile); + string_set(&pService->szLppausecommand, + tmp ? tmp : "vlp lppause %p %j"); + TALLOC_FREE(tmp); + + tmp = talloc_asprintf(talloc_tos(), "vlp %s lpresume %%p %%j", + tdbfile); + string_set(&pService->szLpresumecommand, + tmp ? tmp : "vlp lpresume %p %j"); + TALLOC_FREE(tmp); + + tmp = talloc_asprintf(talloc_tos(), "vlp %s queuepause %%p", + tdbfile); + string_set(&pService->szQueuepausecommand, + tmp ? tmp : "vlp queuepause %p"); + TALLOC_FREE(tmp); + + tmp = talloc_asprintf(talloc_tos(), "vlp %s queueresume %%p", + tdbfile); + string_set(&pService->szQueueresumecommand, + tmp ? tmp : "vlp queueresume %p"); + TALLOC_FREE(tmp); + break; + } #endif /* DEVELOPER */ } -- cgit