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

Bug#231770: lintian: Add checks for prompting in maintainerscripts



Luk Claes <luk@debian.org> writes:

> tags 231770 +patch
> thanks

> Hi

> Easy patch included for consideration.

My concern about the simple approach to this (which I never sent to the
bug; my bad) is that the other major use of read besides prompting is for
parsing files.  It's not uncommon to see a construct like:

    while read facility destination ; do
        # do something with facility and destination
    done < /etc/syslog.conf

Your patch won't produce false positives with this, but I don't know if
there are any scripts that do something similar but don't use that
explicit of a loop.  I don't see any in a quick check on my system, but I
only have a few packages installed.

The other problem is that some packages fall back on read when debconf
isn't available (Postfix, for example) and others intentionally don't use
debconf (libc6).  I'm not sure how to handle those cases, and this patch
would definitely give false positives for Postfix unless we think that it
shouldn't support a fallback if debconf is missing.  There are several
other packages on my system with similar fallbacks (flex, fvwm, and
openssh-server) in their *.preinst files.

I wonder if we could work around the case where read is used only as a
fallback by not issuing this diagnostic for scripts that also try to use
debconf and just assume that if the maintainer is using debconf at all,
they know what they're doing.  That leaves the packages that are
intentionally avoiding use of debconf, but maybe if we exempt essential
packages from this check (plus things like libc6 that are essential in
practice), that would cut the false positives down sufficiently.

What do you think?

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>



Reply to: