From a17cb9ee09419f3ae8e0541aee83df55c4777bd0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Fri, 2 Sep 2016 10:00:01 +0200 Subject: [PATCH] s3-printing: pre-create color and PCC directories under print$. Guenther Signed-off-by: Guenther Deschner Reviewed-by: Andreas Schneider --- source3/printing/nt_printing.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 47590f67fc7..c039764734b 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -80,6 +80,11 @@ static bool print_driver_directories_init(void) char *driver_path; bool ok; TALLOC_CTX *mem_ctx = talloc_stackframe(); + const char *dir_list[] = { + "W32X86/PCC", + "x64/PCC", + "color" + }; service = lp_servicenumber("print$"); if (service < 0) { @@ -125,6 +130,28 @@ static bool print_driver_directories_init(void) } } + for (i = 0; i < ARRAY_SIZE(dir_list); i++) { + const char *path; + + path = talloc_asprintf(mem_ctx, + "%s/%s", + driver_path, + dir_list[i]); + if (path == NULL) { + talloc_free(mem_ctx); + return false; + } + + ok = directory_create_or_exist(path, 0755); + if (!ok) { + DEBUG(1, ("Failed to create printer driver " + "architecture directory %s\n", + path)); + talloc_free(mem_ctx); + return false; + } + } + talloc_free(mem_ctx); return true; } -- 2.34.1