[cups] Getting remote/client username and remote hostname
Christoph Litauer
litauer at uni-koblenz.de
Tue May 17 02:37:30 PDT 2016
Dear cups users,
perhaps you can help me with a little problem I am not able to find a solution for.
My cups server runs cups 1.5.4 (printhost). I have several kiosk stations running a local cupsd (1.5.2). All kiosks have a ipp-printer configured pointing to the cups server:
bib01:~# lpstat -v
device for bib-kopierer: ipp://printhost/printers/test
The printer test on the cups server uses the attached ppd-file. As you can see there is a feature "JobType" using this definition:
*JobType HoldPrint/Hold Print: "%% FoomaticRIPOptionSetting: JobType=HoldPrint"
*FoomaticRIPOptionSetting JobType=HoldPrint: "mark\n&&
/usrcode where{pop}{/usrcode()def}ifelse\n&&
(&user;) usrcode (20`date +%y%m%d%R | sed 's/://'`) {setuserinfo} stopped\n&&
cleartomark\n&&
mark {\n&&
<< /JobType 3\n&&
/JobInfo\n&&
<<\n&&
/UserID (&user;)\n&&
/Time(20`date +%y%m%d%R | sed 's/://'`)\n&&
/JobID ()\n&&
isGenuine not isEnhancedFeatures or {\n&&
/HostLoginName (&user;)\n&&
/HostName (&host;)\n&&
}if\n&&
>>\n&&
/JobAttr << /Save 0 >>\n&&
>> /RDeviceProcSet /ProcSet findresource /SetJobType get exec\n&&
}stopped cleartomark\n"
*End
When the client prints to bib-kopierer, the following code is generated:
mark
/usrcode where{pop}{/usrcode()def}ifelse
(remroot) usrcode (201605171114) {setuserinfo} stopped
cleartomark
mark {
<< /JobType 3
/JobInfo
<<
/UserID (remroot)
/Time(201605171114)
/JobID ()
isGenuine not isEnhancedFeatures or {
/HostLoginName (remroot)
/HostName (printhost)
}if
>>
/JobAttr << /Save 0 >>
>> /RDeviceProcSet /ProcSet findresource /SetJobType get exec
}stopped cleartomark
As you can see "&user;" has been substituted by remroot (which is correct) and "&host;" has been substituted by "printhost" (which is wrong).
I think "&host;" should be substituted by the client name originating the printjob.
Is it possible to achieve that? Are there any other variables usable in foomatic printers ppd configs?
--
Kind regards
Christoph
_________________________________________
Christoph Litauer
Uni Koblenz, Computing Centre, Office A 022
Postfach 201602, 56016 Koblenz
Fon: +49 261 287-1311, Fax: -100 1311
More information about the cups
mailing list