[cups.bugs] [HIGH] STR #3074: http-support.c to accept backend names containing an underscore character

Nicolas Martin nicolas.martin at freesurf.fr
Sun Jan 25 06:45:36 PST 2009


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

I noticed that in Cups releases above at least 1.3.7 (Cups release coming
with Ubuntu >= 8.04), there's a problem while loading Canon printer
drivers (distributed by Canon). At least, this concerns PIXMA MP600 and
MP610 Canon drivers, but many more drivers are concerned, as exposed
below.

These drivers used to work fine with Cups 1.2.* or Ubuntu releases <= 7.10

More precisely, trying to install the Canon driver under Cups 1.3.x and
above leads to the following error message in Cups debug logs: 

CUPS-Add-Modify-Printer client-error-not-possible: Valeur erronée pour le
paramètre « device-uri » : « cnij_usb:/dev/usb/lp0 ».
add_printer: httpSeparateURI returned -2

More deeply now: Notice the backend name for this driver, given by Canon:
cnij_usb

Digging a bit more in Cups source code, it appears that function:
httpSeparateURI() in cups/http-support.c performs a backend name check,
and accepts only names that contain the following characters:
alphanum, -, +, and .

Line 889 in cups/http-support.c:
if (isalnum(*uri & 255) || *uri == '-' || *uri == '+' || *uri == '.')

The underscore _ character is currently rejected, leading to the above
error while loading the Canon backend.

Simply change the above line code to:

if (isalnum(*uri & 255) || *uri == '-' || *uri == '+' || *uri == '.' ||
*uri == '_')

Tests with Cups 1.3.7 and 1.3.9 on Ubuntu 8.04 and 8.10 and it works fine.

So: Could you add permanently this change to Cups, so that the Canon
driver with backend name cnij_usb can be loaded.

Regards
Nicolas

Link: http://www.cups.org/str.php?L3074
Version: 1.3-current





More information about the cups-devel mailing list