Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 4034 - lpd problem + solution
lpd problem + solution
Product: Red Hat Linux
Classification: Retired
Component: lpr (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
Depends On:
  Show dependency treegraph
Reported: 1999-07-14 12:35 EDT by Tony Kocurko
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 1999-07-14 12:43:02 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tony Kocurko 1999-07-14 12:35:30 EDT
Situation: Network printer set up on internal LAN.
           Gateway linux box connected to internal LAN and
             to external, campus network.
           Linux box has printer declared through
             control-panel as a remote printer.
           All boxes on internal LAN can print to printer.
           Linux box on external, campus network has the
             printer configured through control-panel as
             a remote printer connected to the gateway box.
           When trying to print from the external Linux box
             to the printer, syslog on the gateway box
             contains this message:

           "Can't create temp cfp file "

Analysis: In lpr-0.35/lpd/printjob.c, there is this pair
          of statements at line 774:

             memcpy((dup_cfpname+7), "XXXXXX", 6);

          These make a copy of the cf file sent by the
          remote computer, but in the case described above,
          the cf file name ends with the fully qualified
          host name (e.g., "cf...music.esd.mun.ca", where
          the ellipsis is filled with the usual cf file
          name characters. Now, the memcpy() invocation
          above will actually embed the "XXXXXX" in the
          cf file name copy rather than append it as the
          mktemp() function demands. (cf. mktemp(2) man

Solution: Replace the line

             memcpy((dup_cfpname+7), "XXXXXX", 6);

          with this:

             memcpy((dup_cfpname + strlen(dup_cfpname) - 6),
                     "XXXXXX", 6);

          With this change, I now have no trouble printing
          from outside the internal LAN, through the gateway
          an to the printer on the internal LAN, assuming,
          of course, that the external host is in either
          /etc/hosts.equiv or /etc/hosts.lpd on the gateway.

Tony Kocurko - Memorial University of Newfoundland
Comment 1 Bill Nottingham 1999-07-14 12:43:59 EDT
Fixed in the latest lpd in Raw Hide. (0.38+)

Note You need to log in before you can comment on or make changes to this bug.