[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lprng
Subject:    Re: [LPRng] LPRng bug in printable chars testing
From:       papowell () astart ! com
Date:       1998-10-29 19:49:42
[Download RAW message or body]

> From majordomo-owner@iona.com Wed Oct 14 11:59:24 1998
> Date: Wed, 14 Oct 1998 13:41:14 -0500 (CDT)
> From: "Dugal James P." <jpd@usl.edu>
> To: lprng@iona.com
> Subject: [LPRng] LPRng bug in printable chars testing
>
> I'm running LPRng 3.5.2 under Solaris 2.6, and I have found that the
> "check_for_nonprintable" flag is not working right.
>
> First, a code fragment from lpr_cpyfiles.c:
>     } else if (format != 'p' && format != 'f' ){
>         printable = 1;
>     } else if( Check_for_nonprintable == 0 ) {
> 	...

>
> Next, a fragment from vars.c, where the keyword structure is filled
> with defaults:
>    /* check for nonprintable file */
> { "check_for_nonprintable", FLAG_K, &Check_for_nonprintable,0,0,"1"},
> ...
>    /*  formats to check for printable files */
> { "xt",  FLAG_K,  &Check_for_nonprintable,0,0},
>
> It appears that xt should be either eliminated, or some other variable
> name than Check_for_nonprintable used, since they are not compatible: flag
> versus string!  The result is that Check_for_nonprintable is initialized
> improperly, apparently to OFF.  So the checks in lpr_cpyfiles.c are not
> performed.

OK.

>
> Since I was interested in preventing the printing of, at a minimum, binary
> and object files under Solaris, I also observed that is_exec() is an empty
> procedure due to ELF format now being used.  This is no big deal, if the
> test for binary content is feasible.  In looking at the allowed chars
> (isprint() and isspace() and BS and ESC), I think perhaps control-D should be
> added, since I've seen PostScript generated that contains this character in
> the first position.  This would be necessary if the input filter auto-detected
> postscript.  Here's a suggested change to lpr_cpyfiles.c:

I disagree.  If you are printing PostScript,  you want to use
lpr -b (binary) format, otherwise it will get turned into text
and printed out as text.

I have fought with this problem too many times.

>
>                         if( !isprint( c ) && !isspace( c )
> !                               && c != 0x08 && c != 0x1B ) printable = 0;
>
> change to:
>                         if( !isprint( c ) && !isspace( c )
> !                               && c != 0x08 && c != 0x1B && c != 0x04) printabl
> e = 0;
>
>
> Regards,
> -- James Dugal,	N5KNX		Internet: jpd@usl.edu
> Associate Director		Ham packet: n5knx@k5arh.#lft.la.usa.noam
> Computing Support Services	US Mail: PO Box 42770  Lafayette, LA  70504
> University of Southwestern LA.	Tel. 318-482-6417	U.S.A.
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic