Remote IP

Matthias Jansen mail at matthiasjansen.de
Thu Oct 11 11:17:49 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.

Thanks for that info! Then the script will be able to parse the cxxxx file to get the hostname.

> > 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".

Yes, I know. This information can be parsed from the cxxxx file.
>
> AFAIK, there is no way to access the client IP or hostname value via an
> environment variable set by CUPS.

So, parsing the cxxxx file will be the only way to retrieve the IP at the moment?

Maybe that would be a feature for one of the next CUPS versions, to provide the remote ip in an env variable.

Thanks for the tips!

Best regards,


Matthias Jansen




More information about the cups mailing list