Paul Novak on Thu, 11 Jul 2002 17:56:04 +0200 (CEST)(envelope-from owner-apsfilter-help@apsfilter.org)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

lpr control file permissions


 
I'm running lpr and looked at a my print logfile (/var/spool/lpd/aps1/log) 
today finally to discover a pile of errors that have been accumulating.  

The permissions of /usr/bin/lpr are:

    -r-s--s--x    1 root     lp          15788 Jun 18  2001 /usr/bin/lpr

Here's my /etc/printcap

    lp|PS;r=600x600;q=high;c=mono;p=letter;m=auto:\
	:lp=:\
	:if=/home/local/APSFILTER/apsfilter/etc/apsfilter/basedir/bin/apsfilter:\
	:sd=/var/spool/lpd/aps1:\
	:lf=/var/spool/lpd/aps1/log:\
	:rm=optra_e312:\
	:af=/var/spool/lpd/aps1/acct:\
	:rp=raw;\
	:mx#0:\
	:sh:
    # APS1_END - don't delete this


The permissions of the /var/spool/lpd/aps1 are

    drwxr-xr-x   17 root     root         4096 Jul  3 16:28 /var
    drwxr-xr-x   16 root     root         4096 Jul  3 16:28 /var/spool
    drwxrwxr-x    3 root     lp           4096 Jul 11 00:15 /var/spool/lpd
    drwxrwxr-x    2 root     lp           4096 Jul 11 01:08 /var/spool/lpd/aps1
    -rw-rw-r--    1 root     lp            119 Jul 11 10:46 /var/spool/lpd/aps1/log


When i run lpr, it apparently creates a control file (such as cfA213baba) in 
/var/spool/lpd/aps1/ and the permissions are:

    -rw-rw----    1 root     root       0 Jul 11 01:08 /var/spool/lpd/aps1/cfA213baba

Because i'm running lpr, when apsfilter runs, "$CONTROL" is null and apsfilter
reads the lock file to find the name of the control file, and then apsfilter
tries to read the control file.   I stuck an "id" command in apsfilter right before
this attempted read of the control file and it showed this:

    uid=1000(pnovak) gid=102(pnovak) groups=7(lp)

I believe apsfilter fails to read "temp" because because neither pnovak nor lp 
have permissions to read it, and I get this error in my log file:

/home/local/APSFILTER/apsfilter/etc/apsfilter/basedir/bin/apsfilter: /var/spool/lpd/aps1/cfA213baba: Permission denied

I'm guessing that I want lpr to create a control file that has "lp", 
instead of "root", as the group owner so apsfilter can read the
control file.  

What did I do wrong and how can I fix it?


Paul  Novak
pdnovak@attbi.com