cups
cups copied to clipboard
CUPS when adding a printer via the web interface gives an incorrect URI device
CUPS when adding a printer via the web interface gives an incorrect URI device
Steps:
- Connect the printer via USB to the PC;
- Menu -> System -> Printing settings (CUPS settings) -> Administration -> Add a printer -> Select the desired printer -> Continue.
Result: hieroglyphs in the "Connection" field.
Details:
- does not depend on the browser and specific printer;
-
- CUPS version 2.4.8 and higher
Expected result: correct display of characters.
A little analysis revealed that this commit f9927a4b08642dffc44cd41689ee70c171f34a39 breaks symbols.
The problem seems to be in this line
Replacing the cgiGetTextfield() function with cgiGetVariable() solves the problem, but is this a correct fix?
}
}
- if ((var = cgiGetTextfield("DEVICE_URI")) != NULL)
+ if ((var = cgiGetVariable("DEVICE_URI")) != NULL)
{
if ((uriptr = strrchr(var, '|')) != NULL)
{
Confirmed, will debug further to determine the best solution.
@michaelrsweet any way I can help? It affects any discovered printer in CUPS Web UI (dnssd, socket, driverless, usb backends).
For others - workarounds are to use temporary queues (if possible), or install the printer via lpadmin (the proper uri gets discovered by lpinfo -l -v, which you can use in the lpadmin command).
OK, so switching back to cgiGetVariable was the right approach, but there were two other places to change:
[master 4fa466735] Fix device URI when adding or modifying a printer (Issue #998)
[2.4.x 21a392d87] Fix device URI when adding or modifying a printer (Issue #998)