WERROR(*fn) (TALLOC_CTX *mem_ctx, NT_USER_TOKEN *token, DATA_BLOB *in, DATA_BLOB *out, uint32_t *needed);
};
+static void prune_printername_cache(void);
+
/********************************************************************
* Canonicalize servername.
********************************************************************/
return WERR_BADFID;
}
- return delete_printer_hook(p->mem_ctx, p->server_info->ptok,
- Printer->sharename, p->msg_ctx);
+ result = delete_printer_hook(p->mem_ctx, p->server_info->ptok,
+ Printer->sharename, p->msg_ctx);
+ if (!W_ERROR_IS_OK(result)) {
+ return result;
+ }
+ prune_printername_cache();
+ return WERR_OK;
}
/****************************************************************************
return true;
}
+static void prune_printername_cache_fn(const char *key, const char *value,
+ time_t timeout, void *private_data)
+{
+ gencache_del(key);
+}
+
+static void prune_printername_cache(void)
+{
+ gencache_iterate(prune_printername_cache_fn, NULL, "PRINTERNAME/*");
+}
+
/****************************************************************************
Set printer handle name.. Accept names like \\server, \\server\printer,
\\server\SHARE, & "\\server\,XcvMonitor Standard TCP/IP Port" See