Skip to content

Commit

Permalink
s3-printing: pre-create color and PCC directories under print$.
Browse files Browse the repository at this point in the history
Guenther

Signed-off-by: Guenther Deschner <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
gd authored and cryptomilk committed Jul 25, 2017
1 parent 5005a3a commit a17cb9e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions source3/printing/nt_printing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit a17cb9e

Please sign in to comment.