Remote IP

Kurt Pfeifle k1pfeifle at gmx.net
Thu Oct 11 10:02:27 PDT 2007


Matthias Jansen wrote:

> in a backend programm I'm writing, I need the information which IP 
> address the printing job is from. The only place I found this infor-
> mation is in the corresponding file /var/spool/cups/c000<id> but this 
> file is per default only readable by root but the process of my 
> backend is spawned as lp.

Backends which are set to 0700 permission and owned by root are run as
root.

> I already tried Net::CUPS (as my backend is 
> a perl script) but this doesn't seem to give me the information I need.
> 
> Is there any other way?

I don't know what info Net::CUPS provides at all. But what you are
looking for is the IPP job attribute called "job-originating-host-name".

AFAIK, there is no way to access the client IP or hostname value via an
environment variable set by CUPS.

-- 
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-devel mailing list