When a printer driver is deleted with the flag DPD_DELETE_UNUSED_FILES All files, that are used by other installed drivers must not be removed. nt_printing.c - printer_driver_files_in_use (...) calls "trim_overlap_drv_files(info, driver.info_3)" to modify the driver info. But the function returns immediately, if an overlapped file is found: if ( trim_overlap_drv_files(info, driver.info_3) ) { free_a_printer_driver(driver, 3); SAFE_FREE( list ); return True; } This might leave out lots of drivers and the info struct is not trimmed correctly. So files, that are in use by other drivers might be accidentally deleted.
Dave, could you please just verify that this doesn't happen in 3.6 and close the bug. Thanks!
(In reply to comment #1) > Dave, could you please just verify that this doesn't happen in 3.6 and close > the bug. Thanks! Looks like this bug was fixed by Martin in commit 205c352caeb32693a02fcfaeb3f18515719ac373, I'll do some quick testing.
This specific bug is no longer a problem in my 3.6.1 test environment. I would still like to propose one patch in the error path to bring behaviour closer to Windows (Server 2k8): The following changes since commit 7fb82a5a247b95bcd981574d6c0db013c954e026: krb5: Require gss_get_name_attribute or Heimdal's PAC parsing to build with krb5 (2012-01-10 23:23:07 +0100) are available in the git repository at: git://git.samba.org/ddiss/samba.git bso4942_deldriver_err_status David Disseldorp (1): spoolss: fix DPD_DELETE_ALL_FILES error return source3/rpc_server/spoolss/srv_spoolss_nt.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
(In reply to comment #3) > git://git.samba.org/ddiss/samba.git bso4942_deldriver_err_status > > David Disseldorp (1): > spoolss: fix DPD_DELETE_ALL_FILES error return > This change is now in the upstream master branch, along with s3-rpcclient: add deldriverex flags argument Both are not required as a fix for this specific bug.
With a fix for bug#8697 this bug remains a problem. The issue is in the conditions around the printer_driver_files_in_use() call - it is not called when DPD_DELETE_UNUSED_FILES is set. 2266 delete_files = r->in.delete_flags & (DPD_DELETE_ALL_FILES|DPD_DELETE_UNUSED_FILES); 2267 2268 /* fail if any files are in use and DPD_DELETE_ALL_FILES is set */ 2269 2270 if (delete_files && 2271 (r->in.delete_flags & DPD_DELETE_ALL_FILES) && 2272 printer_driver_files_in_use(tmp_ctx, 2273 b, 2274 info)) { 2275 status = WERR_PRINTER_DRIVER_IN_USE; 2276 goto done; 2277 } printer_driver_files_in_use() must be called when DPD_DELETE_UNUSED_FILES is set, as it is responsible for trimming overlapping files from the info structure.
The fix for this bug has been commited to master. A check-in for 3.6.x is pending.
Patches for bug #8697 have been pushed to v3-6-test. David, this one can be closed also, right?
(In reply to comment #7) > Patches for bug #8697 have been pushed to v3-6-test. > > David, this one can be closed also, right? Sure can, thanks Karolin!