[cups.general] cups backend and client IP address

Helge Blischke h.blischke at srz.de
Fri Sep 1 09:24:23 PDT 2006


Vieri Di Paola wrote:
> Hi,
> 
> I am testing a custom CUPS backend bash script. I
> would like to receive the client's IP address (as per
> the %I samba option).
> 
> In my smb.conf I've set 
> printcap name = cups
> printing = cups
> in the [printers] section, "print command", "lpq
> command" and "lprm command" are commented out.
> 
> I setup a cups printer with lpadmin and specified a
> deviceuri to point to my custom cups backend script.
> 
> To check the arguments passed to the backend script, I
> put the following in it:
> 
> echo "Arguments: |$1|$2|$3|$4|$5|$6|$7|$8|" >
> /usr/lib/cups/backend/ARGUMENTS.LOG
> 
> When I print from a network client to the printer
> share  I can record username, filename, etc. but I
> can't find the client's IP address.
> 
> I believe it can be passed within smb.conf with the %I
> argument within the -o option but I don't really know
> how to do this. Can someone please give me a hint?
> 
> Thanks,
> 
> Vieri
> 

You need to get the "job-originating-host-name" attribute
either by using the CUPS api or - at your own risk for compatibility
with future versions - extract that attribute from the job's
control file (the cnnnnn file in the spool directory, where nnnnn
is the job number).

Helge


-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de




More information about the cups mailing list