[redhat-lspp] CUPS configuration: Get-Notifications

Tim Waugh twaugh at redhat.com
Mon Apr 16 12:45:06 UTC 2007


On Fri, 2007-04-13 at 16:14 -0400, Matt Anderson wrote:
> Is this the config file lines you were thinking we needed?
> 
> <Limit Create-Subscription Renew-Subscription Get-Notifications>
>   AuthType Basic
>   Require user @SYSTEM
>   Order deny,allow
> </Limit>

Yes.

> I added that to my system and the server parsed the config file,
> accepted the options and was able to start, but I'm not sure how to test
> the attack you are describing.  I get the feeling this would require a
> custom client.

You can use the Python bindings for the CUPS API, used by
system-config-printer.  The most recent version (1.9.21) has support for
subscriptions.

Fetch: http://cyberelk.net/tim/data/pycups/pycups-1.9.21.tar.bz2

and untar it, and run 'make'.  Then run 'python' and paste this in:

==>
import cups
c=cups.Connection()
s=c.createSubscription("/", events=['all'])
<==

Then print a job or something in another window, and paste this into the
Python session:

==>
event=c.getNotifications([s])['events'][0]
for name, value in event.iteritems(): print name, ":", value

c.cancelSubscription(s)
<==

You should get a dict showing you lots of stuff.  Here's what I get
after submitting a job, for instance:

==>
job-name : (stdin)
notify-job-id : 813
notify-natural-langugage : en-us
notify-sequence-number : 1
notify-subscribed-event : job-created
printer-state-reasons : none
job-impressions-completed : 0
printer-is-accepting-jobs : True
notify-printer-uri : ipp://cyberelk.elk:631/printers/stylus
job-state-reasons : none
notify-subscription-id : 10
notify-text : Job created.
printer-name : stylus
notify-charset : utf-8
printer-up-time : 1176727350
job-state : 3
printer-state : 3
<==

Tim.
*/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/redhat-lspp/attachments/20070416/e0fc7aa1/attachment.sig>


More information about the redhat-lspp mailing list