I create a CUPS queue on my locally installed CUPS and share it (turn sharing for CUPS on and also mark the printer itself shared). On remote machines it gets visible by that, as expected.
Now I call cupsEnumDests() like this:
cupsEnumDests(CUPS_DEST_FLAGS_NONE, 1000, NULL, 0, 0,
(cups_dest_cb_t)add_dest_cb, dest_list);
to let the callback function add_dest_cb() add all printers reported to dest_list.
In the end the list contains all permanent queues which I have created and it also contains the IPP printers discovered in the network (advertsed via DNS-SD).
This is all OK, but cupsEnumDests() also discovers the shared printers on my local CUPS. So if I have created a queue named printer and shared it and the host name of my local machine is my_cups_server, cupsEnumDests() also lists a discovered printer making up a temporary queue named printer_my_cups_server and when printing to it this queue gets created with the device URI ipps://my_cups_server:631/printers/printer making my CUPS daemon passing on a job to this queue to itself, into the queue printer.
cupsEnumDests() (or cupsd if it is doing the "dirty work" for this function) needs a filter to exclude temporary queues for shared
local (from the same cupsd) printers.
I create a CUPS queue on my locally installed CUPS and share it (turn sharing for CUPS on and also mark the printer itself shared). On remote machines it gets visible by that, as expected.
Now I call
cupsEnumDests()like this:to let the callback function
add_dest_cb()add all printers reported todest_list.In the end the list contains all permanent queues which I have created and it also contains the IPP printers discovered in the network (advertsed via DNS-SD).
This is all OK, but
cupsEnumDests()also discovers the shared printers on my local CUPS. So if I have created a queue namedprinterand shared it and the host name of my local machine ismy_cups_server,cupsEnumDests()also lists a discovered printer making up a temporary queue namedprinter_my_cups_serverand when printing to it this queue gets created with the device URIipps://my_cups_server:631/printers/printermaking my CUPS daemon passing on a job to this queue to itself, into the queueprinter.cupsEnumDests()(or cupsd if it is doing the "dirty work" for this function) needs a filter to exclude temporary queues for sharedlocal (from the same cupsd) printers.