Printer Queue control

Heinz Christian Christian.Heinz at nbg9.siemens.de
Fri Jun 11 16:11:31 GMT 1999


> ----------
> From: 	Mike Oswell[SMTP:oswell at xcert.com]
> Reply To: 	oswell at xcert.com
> Sent: 	Donnerstag, 10. Juni 1999 22:25
> To: 	Multiple recipients of list
> Subject: 	Printer Queue control
> 
> 
> I am setting up samba as a print server on a FreeBSD machine.  I would
> like the users to be able to control the print queue by using the Pause
> option in Windows NT.  It seems that I have a permission problem doing
> this though.  
> 
> -- Portion of smb.conf --
> 
> [global]
> 	lpq command             = /usr/bin/lpq -P%p
>         lprm command            = /usr/bin/lprm -P%p %j
>         queuepause command      = /usr/sbin/lpc stop %p
>         queueresume command     = /usr/sbin/lpc start %p
> 
> [HPLaserJ]
>         comment         = HP LaserJet 5P/5MP
>         path            = /var/spool/lpd/printer-1-raw
>         printer driver  = HP Laserjet 5P/5MP PostScript
>         printer         = printer-1-raw
>         writable        = no
>         public          = yes
>         printable       = yes
> 
> 
> % normal user> /usr/sbin/lpc start HPLaserJ
> ?Privileged command
> 
> This is fixable, but I don't like the fix as I have to add each user into
> the operator group..  Even so, if I do this;
> 
> % normal user> groups
> staff operator
> 
> % normal user> /usr/sbin/lpc start HPLaserJ
> HPLaserJ:
>         cannot enable printing
> lpc: connect: Permission denied
>         couldn't start daemon
> 
> 
> ---------
> 
> I had thought it might be permissions on the queue lock file or something
> along those lines but doesn't seem to make any difference.
> 
> Anyone have any ideas on how I can get normal users to be able to pause
> and restart a printer without having to add them into the operator group?
> 
> -- 
> Mike Oswell
> Xcert International Inc
> 
> 
> 
We have a solution for redhat 6.0/samba 2.0.3 - but i think it will work with all versions of the lp-system:

This is mainly a problem with your printing-system, but samba is affected though.
Samba passes the jobs to the printing-system - with root/bin:lp as owner.
There is no way to change these jobs, unless you are the superuser or the owner.
But all commands for maintaining the printing-system have their own permission-handling:
They use the job-description files (files in queue directory with "cXXXXXXXXXX") for the print-jobs (dXXXXXXX) and there is an entry with the username (Pusername).
Based on this information, they grant or deny the appropriate operations.
All you have to do is to write some small scripts for "lprm command", "pause command", "resume command" that change these entries to the appropriate username (the one that calls these scripts). But beware: some commands parse the files from beginning to end - others from end to beginning, so it´s not as easy as adding a new "Puser"-line to the files  ;-) - you must change the line...


Christian Heinz
fon: +49 911 654 7539
fax: +49 911 654 3916
EMail: christian.heinz at nbg9.siemens.de
       100750.65 at compuserve.com





More information about the samba mailing list