Description of problem: If a printer is listed multiple times in /etc/cups/printers.conf, a 'restart' operation will succeed but a 'reload' will cause a segfault in the scheduler. Version-Release number of selected component (if applicable): 1.1.22-0.rc1.9.20.2.el4_6.8 How reproducible: Every time. Steps to Reproduce: 1. Create a cups printer config (/etc/cups/printers.conf) and list the same printer twice. 2. Run 'service cups reload'. Actual results: Cups segfaults (see additional info). Expected results: Cups should not segfault, but treat the (admittedly erronous) double entries in the same way as it does when you (re)start cups. Additional info: Breakpoint 1, mimeDeleteType (mime=0x552abe9bd0, mt=0x552af54840) at mime.c:133 133 free(mt->type); 1: mt->type = 0x47ffffff7 <Address 0x47ffffff7 out of bounds> (gdb) The pointer that is being freed is not NULL.
Test case to reproduce needs to be modified a bit: the printer names must be the same, but the device must be different. I will attach an example that works.
Created attachment 310424 [details] Example printers.conf that causes a segfault
This request was evaluated by Red Hat Product Management for inclusion, but this component is not scheduled to be updated in the current Red Hat Enterprise Linux release. If you would like this request to be reviewed for the next minor release, ask your support representative to set the next rhel-x.y flag to "?".
Filed upstream with patch.
Release note added. If any revisions are required, please set the "requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: * printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device containing the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.
Release note updated. If any revisions are required, please set the "requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -* printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device containing the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.+* printers in CUPS should have unique names. However, if a CUPS configuration file somehow contained entries for more than one device with the same name, the CUPS scheduler would create a segmentation fault and crash while starting up. CUPS now includes code that examines each printer while loading it from the configuration file. CUPS will not attempt to load duplicate entries, but will log an error.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2009-0989.html