{NULL, "", -1 }
};
+static bool print_driver_directories_init(void)
+{
+ int service, i;
+ char *driver_path;
+ bool ok;
+ TALLOC_CTX *mem_ctx = talloc_stackframe();
+
+ service = lp_servicenumber("print$");
+ if (service < 0) {
+ /* We don't have a print$ share */
+ DEBUG(5, ("No print$ share has been configured.\n"));
+ return true;
+ }
+
+ driver_path = lp_pathname(mem_ctx, service);
+ if (driver_path == NULL) {
+ return false;
+ }
+
+ ok = directory_create_or_exist(driver_path, sec_initial_uid(), 0755);
+ if (!ok) {
+ DEBUG(1, ("Failed to create printer driver directory %s\n",
+ driver_path));
+ talloc_free(mem_ctx);
+ return false;
+ }
+
+ for (i = 0; archi_table[i].long_archi != NULL; i++) {
+ const char *arch_path;
+
+ arch_path = talloc_asprintf(mem_ctx,
+ "%s/%s",
+ driver_path,
+ archi_table[i].short_archi);
+ if (arch_path == NULL) {
+ talloc_free(mem_ctx);
+ return false;
+ }
+
+ ok = directory_create_or_exist(arch_path,
+ sec_initial_uid(),
+ 0755);
+ if (!ok) {
+ DEBUG(1, ("Failed to create printer driver "
+ "architecture directory %s\n",
+ arch_path));
+ talloc_free(mem_ctx);
+ return false;
+ }
+ }
+
+ talloc_free(mem_ctx);
+ return true;
+}
+
/****************************************************************************
Open the NT printing tdbs. Done once before fork().
****************************************************************************/
{
WERROR win_rc;
+ if (!print_driver_directories_init()) {
+ return false;
+ }
+
if (!nt_printing_tdb_upgrade()) {
return false;
}