I am reporting this for RedHat 6.0 but it also occurs under 5.2. I recently changed my printer connection from a parallel port connection one via an HP JETDIRECT EX PLUS box -- the printer (HP 4000) remained the same. Linux is configured with the printer as an LPD remote at an IP address (e.g., 10.10.10.100) and queue pscript [this name does not seem to matter). Everthing works fine in that output is properly printed BUT every print job results in an email msg sent to the user whose job was printed: From: bin <bin> Subject: lp printer job "<unknown>" Your printer job was not unlinked: primission denied Gene
Is the message coming from the local machine or the JetDirect box? ------- Email Received From "Gene C." <genec> 05/10/99 18:49 -------
What are the permissions on the files still remaining in the spool directory? (and the permissions on the spool directory)
After a bit of looking at the my sitution I have located the bugs in the lpr code -- specifically in lpd/printjob.c. 1. The code supporting network printers (or spooling to another lpd system) is really kludgy!! This stuff needs a rewrite bigtime. I am not sure if the patches will work in "all" cases but they "seem to fix the basic problems. 2. Ths first bug is the use of fputs rather than fprintf which causes two cpf lines to be merged. diff -uNr lpr-0.36.orig/lpd/printjob.c lpr-0.36/lpd/printjob.c --- lpr-0.36.orig/lpd/printjob.c Mon May 10 11:06:22 1999 +++ lpr-0.36/lpd/printjob.c Fri May 21 20:58:03 1999 @@ -896,7 +896,7 @@ else { if (dup_cfp) - fputs(line, dup_cfp); + fprintf(dup_cfp, "%s\n", line); } sendresult = sendfile('\3', last+1); 3. The second bug is that the code really trys to delete a file twice. This patch ignore an error indicating that the unlink is for a file which does not exist. diff -uNr lpr-0.36.orig/lpd/printjob.c lpr-0.36/lpd/printjob.c --- lpr-0.36.orig/lpd/printjob.c Fri May 21 21:16:26 1999 +++ lpr-0.36/lpd/printjob.c Fri May 21 21:55:34 1999 @@ -1191,6 +1191,21 @@ char *host; char *user; { + /* this hack duplicates some code but things should work better */ + /* if the file does not exist, do not worry about doing unlink */ + int ret; + extern int errno; + if ((strchr(file,'/') == NULL) && + (strstr(file,"..") == NULL)) { + ret = unlink(file); + if (ret == 0) + return; + if (errno == 2) + return; + syslog(LOG_ERR,"unlink file=%s, ret=%i, errno=%i", + file, ret, errno); + } + if (dounlink(file, host, user)) sendmail(user, UNLINK); } These patches were created against source obtained from 1.3.7 of rawhide. ------- Email Received From "Gene C." <genec> 05/21/99 23:22 -------
fixed in lpr-0.37...