Technical article 109206

"lpstat -v" displays corrupt output when remote printing is configured.

OpenServer 5.0.4

Written · Last revised

Problem

I have configured many remote printers on SCO OpenServer Release 5.0.4. I have noticed that when I execute "lpstat -v", some of the remote printer names and machine names are corrupt.

This may also cause SCO VisionFS to fail, since VisionFS relies upon the output of "lpstat -v" to check which printers are available when it initially starts up.

Cause

lpstat(C) uses the entries in the file /etc/printcap (see
printcap(SFF)) in order to display the names of the configured
remote printers, their associated devices and remote machines.
For example, an entry in /etc/printcap for the printer prt219
such as:
prt219:\
    :lp=:rm=remsys:ex:rp=remptr219:sd=/usr/spool/lpd/remprt219:

would result in the following output for the command "lpstat -v":

device for prt219 is the remote printer remptr219 on remsys

lpstat(C) maintains a buffer of 512 characters which it uses to
accumulate _all_ of the remote printer and machine names in
/etc/printcap. (The remote printer and machine names correspond
to the "rp=" and "rm=" fields respectively.)
Thus, in the above example, the number of characters stored by
lpstat(C) would be 17 (each name is terminated by a null character).

If the number of characters for all of the remote printer and machine names in /etc/printcap exceeds 512, this may result in the corruption of output from "lpstat -v".

Solution

This has been fixed in SCO OpenServer 5.0.5.

From the Xinuos technical article database, record 109206. Reproduced with permission. The original is at www.sco.com/ta/109206, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.