s3: Make vlp printing work by default
authorVolker Lendecke <vl@samba.org>
Sat, 2 Apr 2011 16:51:55 +0000 (18:51 +0200)
committerVolker Lendecke <vlendec@samba.org>
Tue, 5 Apr 2011 11:12:14 +0000 (13:12 +0200)
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Apr  5 13:12:14 CEST 2011 on sn-devel-104

source3/param/loadparm.c

index 172e5c446ab9bfa65da78b42929d5a7b7bd57d0e..0f76f0925a50fadf3466d3fd719f5de143cc3f1d 100644 (file)
@@ -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 */
 
        }