Bug 4034 - lpd problem + solution
Summary: lpd problem + solution
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: lpr
Version: 6.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 1999-07-14 16:35 UTC by Tony Kocurko
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-07-14 16:43:02 UTC

Attachments (Terms of Use)

Description Tony Kocurko 1999-07-14 16:35:30 UTC
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 16:43:59 UTC
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.