Custom CGIs

Opher Shachar ophers at ladpc.co.il
Sat Dec 16 23:43:23 PST 2006


Hello,
I created a custom CGI and placed it in /usr/share/cups/doc.
One functionality of the CGI is to send back files:
I write to stdout:
     Content-type: text/plain; charset=<either of utf-8 or iso-8859-8>
or
     Content-type: application/postscript
     Content-length: <file size>

Then the file (I leave an extra newline after the headers) but on the browser side I see a blank page and eventually timeout.
(It all works fine when sending text/html content)

Q: Does CUPS support anything but text/html from its CGIs?

Another thing, the CUPS CGIs (admin.cgi, jobs.cgi ...) have a nice trait that they will ask for a new Authentication as needed.
ex. say I authenticated as the job owner to do "Hold Job" but I need admin preveliges to to "Hold Job" on a job I don't own - I'll be ask to re-authenticate instead of getting "Not Authorized/access denied" or the likes.

Q: How can my CGI signal the CUPS Web Server to ask the User Agent (eg. InternetExplorer / FireFox) for Authentication.

Thanks,
Opher Shachar.




More information about the cups mailing list