michaelrsweet / pappl

PAPPL - Printer Application Framework
https://www.msweet.org/pappl
Apache License 2.0
309 stars 49 forks source link

When giving a new printer a name of only digits PAPPL always tells that this name already exists #161

Closed tillkamppeter closed 3 years ago

tillkamppeter commented 3 years ago

If I add a new printer via the "Add Printer" button in the web interface and enter as queue name a string of onluy digits, like 1111, 12345, ... I always get the response that a printer with this name already exists, independent which sequence of digits I choose.

If for some reason such names cause problems, for example for CUPS picking up this printer as temporary queue, or generally for IPP clients, and therefore such a name is not allowed, please let PAPPL respond with a decent error message (like "Printer name has to contain at least one letter" or similar).

michaelrsweet commented 3 years ago

The issue is that /ipp/print/NNN gets recognized as a job ID for the default printer. I'll update the code to require a printer name that starts with a non-digit.

michaelrsweet commented 3 years ago

OK, so I've updated papplPrinterCreate to sanitize the resource path (not just a straight /ipp/printer/printer-name) so that you can still specify any arbitrary string (still needs to be valid Network Unicode UTF-8 per STD 92).

[master aba1f90] Fix adding of printers whose names contain special characters (Issue #161)

[v1.0.x 75824e9] Fix adding of printers whose names contain special characters (Issue #161)

tillkamppeter commented 3 years ago

It works. I can create a printer names "1111" now and everything works with it. Thank you very much.