ftp.nice.ch/pub/next/tools/system/Quotas.N.bs.tar.gz#/Quotas/Source/pageq

Makefile
 
README
 
addpu.c
[View addpu.c] 
addpu.root.c
[View addpu.root.c] 

exceeded.wn


 
getpq.c
[View getpq.c] 
getpu.c
[View getpu.c] 
pagecount.c
[View pagecount.c] 
psif
 
quota.h
[View quota.h] 
setpq.c
[View setpq.c] 
setpu.c
[View setpu.c] 

README

This directory contains printer page accounting utilities.

A user's NetInfo directory should be updated by an
administrator to contain the properties "pagequota"
and "pageusage", with appropriate initial values.
For example, pagequota might be set to 100, and
pageusage to 0 initially, and reset to 0 monthly.
This can be done with setpq (set page quota), and
setpu (set page usage).  The NetInfo utility "setall"
that is included in this package may also be used
to set all pageusage values to 0.

The included "psif" should replace the existing
/usr/lib/transcript/psif file.  Make a backup
copy of the old one!  This version does the
following additional things:

1 connect to the printer and get the current page count
  before and after printing a document.
2 add the number of pages printed to the user's pageusage

Step 1 is done with the help of the program "pagecount",
which opens the printer's tty and talks to the PostScript
interpreter.  NOTE: This doesn't work with a NeXT printer,
because the printer has no PostScript interpretor.

Step 2 is done by addpu.  NOTE: This program needs root
access to update NetInfo.  It must be made set-uid root.
However, there is a fly in the ointment.  If the printer
is served by the NetInfo Master, this system will work.
If the NetInfo Network Domain is servered by another host,
the addpu process will not have rights to modify the
users pageusage value.  The only workaround that I have
been able to cook up is to put the network root password
in the code for addpu, and have it call ni_setpassword();
This is awful, and creates a security hole.  The source
for this is in addpu.root.c.  If anyone installing this
can figure out a way to get around this, please let the
world know!  -- Marc

If the user's pageusage exceeds the pagequota, the print
job is cancelled and a cancellation page is printed.  The 
file Quotas/exceeded.ps is a prototype page, with fields
that are replaced when printed by psif.

NOTE TO INSTALLERS:
There are two paths that need to be changed for your site:
1: psif needs to find "exceeded.ps".  The default is
   /usr/adm/exceeded.ps.  Change line 20 of psif.
2: pagecount.c has a logfile.  The default is "/usr/adm/printlog".
   Change line 3.

Files are:

addpu
	add to a user's page usage.

exceeded.wn
	WriteNow version of cancellation page.

getpq
	get a user's page quota.

getpu
	get a user's page usage.

pagecount
	get the printer's pagecount

psif
	new version of /usr/lib/transcript/psif.

setpq
	set a user's page quota.

setpu
	set a user's page usage.

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.