Author: he
Date: 2005-06-26 13:58:05 +0200 (Sun, 26 Jun 2005)
New Revision: 423

Modified:
   trunk/checks/scripts
   trunk/checks/scripts.desc
   trunk/debian/changelog
Log:
checks/scripts:
 + [HE] Check for use of adduser and update-inetd and warn if the package
   has no (pre-)dependency on adduser/netbase. Patch by Russ Allbery,
   thanks for the work. (Closes: #308569)



Modified: trunk/checks/scripts
===================================================================
--- trunk/checks/scripts        2005-06-26 11:42:18 UTC (rev 422)
+++ trunk/checks/scripts        2005-06-26 11:58:05 UTC (rev 423)
@@ -397,7 +397,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>) {
@@ -478,6 +478,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", "";

Modified: trunk/checks/scripts.desc
===================================================================
--- trunk/checks/scripts.desc   2005-06-26 11:42:18 UTC (rev 422)
+++ trunk/checks/scripts.desc   2005-06-26 11:58:05 UTC (rev 423)
@@ -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 &lt;alternative&gt; foo' is called in the

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2005-06-26 11:42:18 UTC (rev 422)
+++ trunk/debian/changelog      2005-06-26 11:58:05 UTC (rev 423)
@@ -10,6 +10,9 @@
   * checks/scripts:
     + [HE] Allow Scripts in /etc/Xsession.d/ to be not executable, as they're
       not directly called, but only sourced. (Closes: #309203)
+    + [HE] Check for use of adduser and update-inetd and warn if the package
+      has no (pre-)dependency on adduser/netbase. Patch by Russ Allbery,
+      thanks for the work. (Closes: #308569)
 
  -- Marc 'HE' Brockschmidt <[EMAIL PROTECTED]>  Tue, 21 Jun 2005 14:40:53 +0200
 


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to