[cups.general] Passing extra informationfromenvironmenttobackend?

Kurt Pfeifle k1pfeifle at gmx.net
Tue Nov 6 07:33:13 PST 2007


Johannes Meixner wrote:
> Hello,
> 
> On Nov 4 08:26 Kurt Pfeifle wrote (shortened):
>> However, this does *already* work! You need to make sure two things
>> happen:
>>
>>  (a) your startup script (or the commandline that starts) cupsd
>>      does set/export the CENDIO_foobar variable:
>>      CENDIO_foobar="some-value-we-need"
>>
>>  (b) your cupsd.conf does contain a line:
>>      PassEnv CENDIO_foobar
>>
>> From now, every filter backend will be able to see and exploit the
>> env var CENDIO_foobar (see also the cupsd.conf documentation reference
>> about the "PassEnv" parameter).
> 
> This does not work for my CUPS 1.2.7 system.
> 
> I have a line
> PassEnv CENDIO
> in my cupsd.conf.
> 
> I use a selfmade foo backend for a test queue which does
> -------------------------------------------------------------------
> #! /bin/bash
> set -x
> 
> if test "$#" = "0"
> then
>   echo 'direct foo://bar "Unknown" "foo"'
>   exit 0
> fi
> 
> echo CENDIO: "$CENDIO" 1>&2
> 
> exit 0
> -------------------------------------------------------------------
> 
> When I do as normal user
> export CENDIO="some-value"
> echo Hello | lp -d test
> I get in error_log:
> -------------------------------------------------------------------
> D [06/Nov/2007:14:35:34 +0100] [Job 633] + echo CENDIO: ''
> D [06/Nov/2007:14:35:34 +0100] [Job 633] CENDIO: 
> -------------------------------------------------------------------
> 
> For me this is what I expect because how should the environment
> variable be passed from the client program "lp" to the cupsd?

I never assumed or said that "lp" passes the env var.

The env var is passed down by cupsd to the filters, backends and
other child processes.

So it passes down the value it reads when it itself was starting
up.

> As far as I understand the PassEnv documentation it means that
> an environment variable which is known to the cupsd would be
> passed to its childs but as far as I see, this doesn't mean
> that a client program like "lp" passes the environment variable
> to the cupsd.

Correct.

Sorry if my post was unclear and did imply otherwise.

-- 
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH  .....................  Hedelfinger Strasse 58
A RICOH Company  ...........................  D-70327 Stuttgart/Germany




More information about the cups mailing list