diff options
-rw-r--r-- | source3/rpc_server/spoolss/srv_spoolss_nt.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c index 07a9f82620..c691b4a1f5 100644 --- a/source3/rpc_server/spoolss/srv_spoolss_nt.c +++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c @@ -2173,15 +2173,17 @@ static WERROR spoolss_dpd_version(TALLOC_CTX *mem_ctx, delete_files = r->in.delete_flags & (DPD_DELETE_ALL_FILES | DPD_DELETE_UNUSED_FILES); - /* fail if any files are in use and DPD_DELETE_ALL_FILES is set */ - if (delete_files && - (r->in.delete_flags & DPD_DELETE_ALL_FILES) && - printer_driver_files_in_use(mem_ctx, - b, - info)) { - status = WERR_PRINTER_DRIVER_IN_USE; - goto done; + if (delete_files) { + bool in_use = printer_driver_files_in_use(mem_ctx, b, info); + if (in_use && (r->in.delete_flags & DPD_DELETE_ALL_FILES)) { + status = WERR_PRINTER_DRIVER_IN_USE; + goto done; + } + /* + * printer_driver_files_in_use() has trimmed overlapping files + * from info so they are not removed on DPD_DELETE_UNUSED_FILES + */ } |