Bug 15321 - Printer driver upload not "case-insensitive" when replacing older versions
Summary: Printer driver upload not "case-insensitive" when replacing older versions
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Printing (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: printing-maintainers
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-02 09:38 UTC by Felix Botner
Modified: 2023-03-02 09:39 UTC (History)
0 users

See Also:


Attachments
nt_printing_move_driver_file_to_download_area.patch (1.01 KB, patch)
2023-03-02 09:39 UTC, Felix Botner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner 2023-03-02 09:38:52 UTC
I have the following printer driver:

Lexmark_Universal_v2_UD1_PCL5_Emul_02212020.exe 
  -> UNIDRV.DLL (0.3.16299.396)
(HP) upd-pcl6-x64-6.3.0.21178.exe 
  -> unidrv.dll (0.3.9600.18048)

Windows:

On windows 10 if i install the HP driver first (unidrv.dll) and then the Lexmark driver (UNIDRV.DLL), the unidrv.dll file is overwritten/replaced with the newer version in 'x64/3/UNIDRV.DLL' (case-insensitive)

Samba:

Samba also does the version check but then the file is copied as is:

handle_pe_file: PE file [x64/{3CB1B0AC-3235-4813-AE84-C02C64D37F60}/UNIDRV.DLL] Version = 00000003:3fab018c (0.3.16299.396)
handle_pe_file: PE file [x64/3/UNIDRV.DLL] Version = 00000003:25804680 (0.3.9600.18048)
 file_version_is_newer: Replacing [x64/3/UNIDRV.DLL] with [x64/{3CB1B0AC-3235-4813-AE84-C02C64D37F60}/UNIDRV.DLL]
[2023/02/20 10:45:19, 10, pid=20257, effective(0, 5000), real(0, 0)] ../../source3/printing/nt_printing.c:1456(move_driver_file_to_download_area)
move_driver_file_to_download_area: copying 'x64/{3CB1B0AC-3235-4813-AE84-C02C64D37F60}/UNIDRV.DLL' to 'x64/3/UNIDRV.DLL'

and i end up with two files UNIDRV.DLL and unidrv.dll in 'x64/3' which leads to strange behaviors when downloading printer driver with windows clients.

The problem seems to be that source3/printing/nt_printing.c::move_driver_file_to_download_area just copies the new file instead of replacing the old one.

See nt_printing_move_driver_file_to_download_area.patch for a possible solution (driver_unix_convert for new driver file).
Comment 1 Felix Botner 2023-03-02 09:39:32 UTC
Created attachment 17786 [details]
nt_printing_move_driver_file_to_download_area.patch