[cups.general] Passing extra information from environment tobackend?

Erik Forsberg forsberg at cendio.se
Fri Oct 19 04:06:32 PDT 2007


> Johannes Meixner wrote:
> > Hello,
> > 
> > On Oct 18 05:00 Erik Forsberg wrote (shortened):
> >> Is there some way to pass information from the environment of the
> >> user submitting a print job (via 'lp', 'lpr' or some program using
> >> libcups, for example KDE's or Gnome's printer systems), to the
> >> backend?
> > 
> > A command like
> > lp -o myoption=whatever ...
> > will make "myoption=whatever" available for filters and for the
> > backend as argv[5] (if I remember correctly), see "man backend".
> >  
> >> I want to know, in my backend, not only which user submitted the
> >> job, but also which session in a thin client scenario the user was
> >> submitting from (each user may have multiple sessions).
> > 
> > This is not possible with 'lp' or 'lpr' as is but you could make
> > a wrapper script which determines what you need and then let it
> > call 'lp' with appropriate special option settings which are
> > then evaluated by your special selfmade backend.

That is unfortunately not good enough, as that will not cover programs
printing directly via libcups (kdeprint, etc.).
 
> One could also store the "myoption=whatever" setting in one of
> 
>   /etc/cups/lpoptions
>   ~/.cups/lpoptions
> 
> (depending on: is the setting user-specific or not?) and rely on it
> being picked up by the lp/lpr commands automatically.

Interesting, but will not solve the problem - I might have explained
badly, but as the same user may have several sessions, on the same
machine, and I want to distingush between sessions in my backend,
setting lpoptions in ~/.cups/lpoptions will not help, as these will be
used by all sessions.

If there were an environment variable for lpoptions being picked up by
libcups, that would help, because this variable could be set
differently in different sessions. 

As far as I can see, there is no such environment variable. Would a
patch providing that functionality be accepted? 

Regards,
\EF
-- 
Erik Forsberg                OpenSource-based Thin Client Technology
Systems Analyst/Developer    Phone: +46-13-21 46 00    
Cendio AB    	             Web: http://www.cendio.com




More information about the cups mailing list