Bug 2676
Summary: | Printer job was not unlinked | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | genec |
Component: | lpr | Assignee: | David Lawrence <dkl> |
Status: | CLOSED NEXTRELEASE | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 6.0 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 1999-06-17 21:18:37 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
genec
1999-05-09 01:39:24 UTC
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... |