Bug 2745 - "hack" support of IF in lpd breaks remote printing
"hack" support of IF in lpd breaks remote printing
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: lpr (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-05-11 15:46 EDT by timw
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:
Environment:
Last Closed: 1999-05-12 10:59:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description timw 1999-05-11 15:46:34 EDT
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 17:23:59 EDT
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 10:59:59 EDT
fixed in lpr-0.36-3

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