Skip to content

Show the rejected device-uri in CUPS-Create-Local-Printer errors - #1782

Merged
michaelrsweet merged 1 commit into
OpenPrinting:masterfrom
Ar-maan05:fix-local-printer-uri-message
Oct 22, 2026
Merged

michaelrsweet merged 1 commit into
OpenPrinting:masterfrom
Ar-maan05:fix-local-printer-uri-message

Conversation

@Ar-maan05

Copy link
Copy Markdown
Contributor

CUPS-Create-Local-Printer with an unsupported device-uri always reports an empty URI:

before: CUPS-Create-Local-Printer: Bad device-uri "".
after:  CUPS-Create-Local-Printer: Bad device-uri "socket://10.0.0.5".

The message uses ptr, which by then has been walked to the end of printer-name by the loop that sanitizes the queue name. 2.4.x passes device_uri_ptr here; master switched to ptr in 9fa1c04. This puts device_uri_ptr back, with a fallback to "" since that branch also runs when it is NULL.

Tested against a local cupsd built from master, sending the request over the domain socket, before and after the change.

create_local_printer() reported a bad device-uri with ptr, which at that point is left at the end of printer-name by the name sanitizing loop, so the message was always 'Bad device-uri "".'. Use device_uri_ptr like 2.4.x does.

@michaelrsweet michaelrsweet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@michaelrsweet michaelrsweet self-assigned this Oct 22, 2026
@michaelrsweet michaelrsweet added the bug Something isn't working label Oct 22, 2026
@michaelrsweet michaelrsweet added this to the v2.4.x milestone Oct 22, 2026
@michaelrsweet
michaelrsweet merged commit 61d5111 into OpenPrinting:master Oct 22, 2026
6 checks passed
@Ar-maan05
Ar-maan05 deleted the fix-local-printer-uri-message branch October 22, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants