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); mktemp(dup_cfpname); 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 page) 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. Cheers, Tony Kocurko - Memorial University of Newfoundland
Fixed in the latest lpd in Raw Hide. (0.38+)