Limiting list of printers seen by user?

Erik Forsberg forsberg at cendio.se
Fri Oct 28 04:19:37 PDT 2005


Erik Forsberg <forsberg at cendio.se> writes:
> I was correct. The problem is that there are a whole bunch of programs
> that create their own CUPS queries, without using libcups. The KDE
> printing system (at least in KDE 3.4 on FC3) seems to do their own, as
> well as Openoffice 1.1.3. Bah! 
> 
> I tested on Fedora Core 3, because that is the system one of my
> customers, who wants to use this feature, runs. Behaviour may be
> better on other distributions. 
> 
> The above is my conclusion based on observations of the CUPS traffic
> on the network, as well as output from ldconfig for the tested
> applications. I'll happily accept if someone proves me wrong! :-)

Immediately proving myself wrong after some more thorough studies -
KDE does link to libcups, it was just buried more deeply than I
initially thought:

# for file in `rpm -ql kdelibs|grep /usr/lib` ; do ldd $file|grep -q -i libcups ; if [ $? -eq 0 ] ; then echo $file; ldd $file|grep cups; fi; done
/usr/lib/kde3/cupsdconf.so
        libcups.so.2 => /usr/lib/libcups.so.2 (0xb6dcc000)
/usr/lib/kde3/kdeprint_cups.so
        libcups.so.2 => /usr/lib/libcups.so.2 (0xb6bd1000)
/usr/lib/libkdeinit_cupsdconf.so
        libcups.so.2 => /usr/lib/libcups.so.2 (0x00cfc000)

This raises the question - where in the lib is the
requesting-user-name added? Must the application provide it, or will
libcups find out for itself? Source code inspection seems to suggest
the latter. Odd.

Hmm.. on the other hand, inspecting the packets sent, and the source
code of cups/util.c, it doesn't seem like the CUPS_GET_PRINTERS call
sends any requesting-user when I run kprinter, or a very simple test
program. Adding code to cupsGetPrinters that adds the
requestion-user-name seems to solve the problem for my simple test
program and openoffice, but not for kprinter. I've filed STR 1335 with
a patch that corrects this.

I'll see if I can track down the problem with kdeprint as well. 

Another observation is that 1.2svn-r4810 seems to duplicate printer
definitions in printers.conf sometimes. Is this a known problem, or
should I try to track it down? 

\EF
-- 
Erik Forsberg                OpenSource-based Thin Client Technology
Cendio AB                    Phone: +46-13-21 46 00    
			     Web: http://www.thinlinc.com
		             




More information about the cups mailing list