Problem report with RH4.0: lpr

Przemek Klosowski (
Thu, 14 Nov 1996 12:49:47 -0500

I upgraded to 4.0 from 3.0.3 and then installed the RPMs from
/pub/redhat/redhat-4.0/updates/axp, including lpr-0.12-1.axp.rpm

'lpr' dumps core when presented with unknown printer

# lpr -Pnosuchprinter
Segmentation fault

It looks like it is due to a questionable code in lpr.c:

fatal("%s: unknown printer", s);

where 'fatal()' is defined as follows:
fatal(msg, a1, a2, a3)
char *msg;
printf("%s: ", name);
printf(msg, a1, a2, a3);

The pointers are implicitly declared as integers, and are truncated.
The proper solution is to define fatal() using varargs; a simple
patch is to declare a1 a2 a3 as void *:

fatal(msg, a1, a2, a3)
char *msg;
+ void *a1, *a2, *a3;

There are 3 places where such unsavory practices take place in lpr-0.12-1:


przemek klosowski <> (301) 975-6249
Reactor Division (bldg. 235), E111
National Institute of Standards and Technology
Gaithersburg, MD 20899, USA

To unsubscribe: send e-mail to with
'unsubscribe' as the subject.  Do not send it to

Feedback | Store | News | Support | Product Errata | About Us | Linux Info | Search | JumpWords
No Frames | Show Frames

Copyright © 1995-1997 Red Hat Software. Legal notices