Bug 2837

Summary: unable to use remote printer-queue because of bug in lpd
Product: [Retired] Red Hat Linux Reporter: e.mergl
Component: lprAssignee: David Lawrence <dkl>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-05-17 14:40:49 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 e.mergl 1999-05-15 09:05:01 UTC
trying to use a remote printer-queue, the lpd wrote the
following messages to syslog:

Can't create temp cfp file
lp: can't scan /var/spool/lpd/LJIIISi

investigating the source showed the follwing bug: in
printjob.c the function mktemp is called with an invalid
template (the LAST 6 chars have to be XXXXXX !). The patch
below fixes the problem:

*** lpr-0.35/lpd/printjob.c.orig        Sat May 15 12:45:14
1999
--- lpr-0.35/lpd/printjob.c     Sat May 15 12:45:57 1999
***************
*** 769,775 ****
        if (IF != NULL)
          {
            dup_cfpname = strdup(file);
!           memcpy((dup_cfpname+7), "XXXXXX", 6);
            mktemp(dup_cfpname);
            tmpmask = umask(007);
            dup_cfp=fopen(dup_cfpname, "w");
--- 769,775 ----
        if (IF != NULL)
          {
            dup_cfpname = strdup(file);
!           memcpy((dup_cfpname+strlen(file)-6), "XXXXXX",
6);
            mktemp(dup_cfpname);
            tmpmask = umask(007);
            dup_cfp=fopen(dup_cfpname, "w");

Comment 1 Jeff Johnson 1999-05-15 20:17:59 UTC
This looks like it might be fixed. Bill?

Comment 2 Bill Nottingham 1999-05-17 14:40:59 UTC
already fixed in lpr-0.36.