[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#3034: SOLVED: can't remove print jobs



Package: lpr
Version: 5.9-11

After quite a long dive in the lpr sources I found the reason that we
can't remove jobs in a remote queue. First, our /etc/hosts was like
this:

1.2.3.4   fully.qualified.domain.name   hostname

Inverting the columns to be like this

1.2.3.4   hostname   fully.qualified.domain.name

solved the problem. Of course, now the machines must be in hosts,
because the DNS will report the FQDN and it won't match.

The real reason is a bug in the lpr suite: lpr writes just the
hostname, as returned by gethostname, in the H line of the control
file. However, lpd checks it against the FQDN, as returned by
gethostbyaddress in the h_name of struct hostent, in the function
isowner() of rmjob.c. The solution is to make lpr determine the FQDN,
as checkremote() in common.c does, for example.

I also found that lockchk in line 156 of rmjob.c is doing a

        if (kill(cur_daemon, 0) < 0) {

I don't think it's right to send a signal number 0, at least it's not
documented. Also it has no effect at all, though it returns 0.
Furthermore, rmjob is also sending SIGINT to the same pid (and this
one works). It looks like lockchk needs some cleanup.

Carlos


Reply to: