Subject: bin/9392: lpq and friends segfault when remote printer has no hostname
To: None <email@example.com>
From: None <firstname.lastname@example.org>
Date: 02/11/2000 13:15:42
>Synopsis: lpq and friends segfault when remote printer has no hostname
>Responsible: bin-bug-people (Utility Bug People)
>Arrival-Date: Fri Feb 11 13:15:01 2000
>Originator: Erik Bertelsen
>Release: NetBSD-current 11 Feb 2000
System: NetBSD rlanarh108.uni-c.dk 1.4S NetBSD 1.4S (HJEMME) #308: Fri Feb 11 19:07:04 CET 2000 email@example.com:/home/src/sys/arch/macppc/compile/HJEMME macppc
lpq and other lpr-related programs will segfault when querying a remote printer,
whose rm-entry in /etc/printcap is given as a dotted-decimal IP address instead of
as a symbolic name (from dns or /etc/hosts).
The culprit is the following code in lpr/common_source/common.c, where ai_canonname
will be NULL in this case:
* if the two hosts are not the same,
* then the printer must be remote.
if (strcasecmp(hname, res->ai_canonname) != 0)
remote = 1;
This code was changed about 27 January (IPv6 support, IIRC), but I don't know whether
this problem existed before that date.