Bug 2745 - "hack" support of IF in lpd breaks remote printing
Summary: "hack" support of IF in lpd breaks remote printing
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: lpr
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lawrence
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-05-11 19:46 UTC by timw
Modified: 2008-05-01 15:37 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 1999-05-12 14:59:59 UTC


Attachments (Terms of Use)

Description timw 1999-05-11 19:46:34 UTC
The code in printjob.c with the comment starting
/* msf - here is where we hack in IF support    */
causes mismatched data and control file names.
The print server here barfs when fed a non-matching control
file name.
The following diff fixes the problem (and hopefully doesn't
break anything else :-)
*** printjob.c  Tue Feb 16 12:01:45 1999
--- /usr/src/redhat/BUILD/lpr-0.35/lpd/printjob.c       Tue
May 11 12:14:09 1999***************
*** 749,754 ****
--- 749,755 ----
        char *dup_cfpname = NULL;
        char *final_cfp;
        FILE *dup_cfp = NULL;
+       char new_suffix[6];

        int  ifi, fi;
        int  ifchild, pid;
***************
*** 771,776 ****
--- 772,778 ----
            dup_cfpname = strdup(file);
            memcpy((dup_cfpname+7), "XXXXXX", 6);
            mktemp(dup_cfpname);
+           memcpy(new_suffix, (dup_cfpname+7), 6);
            tmpmask = umask(007);
            dup_cfp=fopen(dup_cfpname, "w");
            umask(tmpmask);
***************
*** 859,867 ****
                            char tmpfile[20];

                            memcpy(tmpfile, last+1, 7);
!                           memcpy(tmpfile+7, "XXXXXX", 6);
                            tmpfile[13]='\000';
-                           mktemp(tmpfile);

                            /* we make a new f and U entry
for remote cfp */
                            fprintf(dup_cfp,
"f%s\n",tmpfile);
--- 861,868 ----
                            char tmpfile[20];

                            memcpy(tmpfile, last+1, 7);
!                           memcpy(tmpfile+7, new_suffix,
6);
                            tmpfile[13]='\000';

                            /* we make a new f and U entry
for remote cfp */
                            fprintf(dup_cfp,
"f%s\n",tmpfile);

Comment 1 Bill Nottingham 1999-05-11 21:23:59 UTC
Try lpr-0.36-3; it's available
at http://charlotte.redhat.com/~notting/ftp/lpr/, and
will be in the next Raw Hide relase.

Your print server wouldn't happen to be HP-UX, would it?

Comment 2 Bill Nottingham 1999-05-12 14:59:59 UTC
fixed in lpr-0.36-3


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