Bug#308569: lintian: warn for update-inetd/adduser in maint script without depends
Package: lintian
Version: 1.23.8
Severity: wishlist
Tags: patch
The testing being done for the sarge release has revealed that a fair
number of packages use update-inetd in maintainer scripts without a
dependency on netbase or adduser without a dependency on adduser. The
following tested patch adds a check for this.
I'm not sure if more should be said about when this warning may be
ignorable (such as when the invocation is conditional), or if brevity is
the soul of wit.
diff -ru lintian-1.23.8/checks/scripts lintian-1.23.8.new/checks/scripts
--- lintian-1.23.8/checks/scripts 2005-01-14 09:19:55.000000000 -0800
+++ lintian-1.23.8.new/checks/scripts 2005-05-10 23:29:43.000000000 -0700
@@ -396,7 +396,7 @@
open C, "$filename"
or fail("cannot open maintainer script $filename for reading: $!");
- my ($warned_tmp, $warned_killall);
+ my ($warned_tmp, $warned_killall, $warned_netbase, $warned_adduser);
my $cat_string = "";
while (<C>) {
@@ -477,6 +477,20 @@
if (m,\bsuidregister\b,) {
tag "suidregister-used-in-maintainer-script", "$file";
}
+ if (m,\bupdate-inetd\b, && !$warned_netbase) {
+ my $type = $deps{'netbase'};
+ unless ($type and ($type eq 'depends' or $type eq 'pre-depends')) {
+ tag "maintainer-script-needs-depends-on-netbase", "$file";
+ $warned_netbase = 1;
+ }
+ }
+ if (m,\badduser\b, && !$warned_adduser) {
+ my $type = $deps{'adduser'};
+ unless ($type and ($type eq 'depends' or $type eq 'pre-depends')) {
+ tag "maintainer-script-needs-depends-on-adduser", "$file";
+ $warned_adduser = 1;
+ }
+ }
if ($file eq 'postrm') {
if (m,update\-alternatives \-\-remove,) {
tag "update-alternatives-remove-called-in-postrm", "";
diff -ru lintian-1.23.8/checks/scripts.desc lintian-1.23.8.new/checks/scripts.desc
--- lintian-1.23.8/checks/scripts.desc 2005-01-14 13:09:42.000000000 -0800
+++ lintian-1.23.8.new/checks/scripts.desc 2005-05-10 23:19:19.000000000 -0700
@@ -616,6 +616,16 @@
command 'dpkg-statoverride' gives admins more flexibility. Please see
the documentation of suidmanager and dpkg-statoverride for details.
+Tag: maintainer-script-needs-depends-on-netbase
+Type: warning
+Info: This script calls update-inetd, but the package does not depend or
+ pre-depend on netbase, which provides it.
+
+Tag: maintainer-script-needs-depends-on-adduser
+Type: warning
+Info: This script calls adduser, but the package does not depend or
+ pre-depend on the adduser package.
+
Tag: update-alternatives-remove-called-in-postrm
Type: warning
Info: 'update-alternatives --remove <alternative> foo' is called in the
-- System Information:
Debian Release: 3.1
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.4.30
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Versions of packages lintian depends on:
ii binutils 2.15-5 The GNU assembler, linker and bina
ii diffstat 1.39-1 produces graph of changes introduc
ii file 4.12-1 Determines file type using "magic"
ii gettext 0.14.1-10 GNU Internationalization utilities
ii intltool-debian 0.30+20040213 Help i18n of RFC822 compliant conf
ii man-db 2.4.2-21 The on-line manual pager
ii perl [libdigest-md5-perl] 5.8.4-8 Larry Wall's Practical Extraction
-- no debconf information
Reply to: