michaelrsweet / pappl

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

Duplicate "printer-device-id"/"printer-strings-languages-supported" attribute in printer-attributes-tag group #328

Closed szlt5 closed 9 months ago

szlt5 commented 9 months ago

Describe the bug Use below command to get printer attributes.

$ipptool -tv ipp://localhost:8000/ipp/print/foo get-printer-attributes.test

The output shows:

Duplicate "printer-device-id" attribute in printer-attributes-tag group
Duplicate "printer-strings-languages-supported" attribute in printer-attributes-tag group

System Information:

Additional context In function _papplPrinterCopyAttributesNoLock()

ippAddStrings(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE, "printer-strings-languages-supported", IPP_NUM_CAST num_values, NULL, svalues);

should be updated as ↓

ippAddStrings(client->response, IPP_TAG_PRINTER, IPP_TAG_LANGUAGE, "printer-strings-languages-supported", IPP_NUM_CAST num_values, NULL, svalues);

In function make_attrs()

ippAddString(printer->attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-device-id", NULL, printer->device_id);

should be updated as ↓

ippAddString(attrs, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-device-id", NULL, printer->device_id);
michaelrsweet commented 9 months ago

I fixed _papplPrinterCopyAttributesNoLock, but make_attrs already was fixed in 1.4.5.

[master 71f13b9] Fix _papplPrinterCopyAttributesNoLock (Issue #328)

[v1.4.x 8a0713f] Fix _papplPrinterCopyAttributesNoLock (Issue #328)