From 18b94069f0f26a0eccb05ba68648c92c4b8472bf Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Wed, 6 Oct 1999 23:15:47 +0000 Subject: [PATCH] Update update-rc.d to check if codenumber is below 100 --- ChangeLog | 5 +++++ debian/changelog | 1 + scripts/update-rc.d.pl | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac652751..10c78bae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 7 01:16:23 CEST 1999 Wichert Akkerman + + * Check if codenumber is between 0 and 99 instead of just checking + for a number + Wed Oct 6 14:40:33 CEST 1999 Wichert Akkerman * Lock complete lockfile for database: it's empty anyway, and Hurd diff --git a/debian/changelog b/debian/changelog index 382153b5..4f3e93c6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ dpkg (1.4.1.14) unstable; urgency=low * Install locale-files in /usr/share, Closes: Bug# 46631 * Make /usr/share/doc/dpkg-dev a symlink to /usr/share/doc/dpkg * Actually include fix to make update-alternatives works filesystems (oops!) + * Check if codenumber is between 0 and 99, Closes: Bug# 46810 -- Wichert Akkerman Tue, 5 Oct 1999 19:19:05 +0200 diff --git a/scripts/update-rc.d.pl b/scripts/update-rc.d.pl index 71a61068..4289ee63 100644 --- a/scripts/update-rc.d.pl +++ b/scripts/update-rc.d.pl @@ -96,7 +96,7 @@ sub checklinks { } opendir(DIR, "."); foreach $_ (readdir(DIR)) { - next unless (/^[S|K][0-9]*$bn$/); + next unless (/^[S|K]\d\d$bn$/); $fn = "$etcd$i.d/$_"; $found = 1; $islnk = &is_link ($_[0], $fn, $bn); @@ -123,8 +123,8 @@ sub defaults { &usage ("defaults takes only one or two codenumbers") if ($#ARGV > 2); $start = $stop = $ARGV[1] if ($#ARGV >= 1); $stop = $ARGV[2] if ($#ARGV >= 2); - &usage ("codenumber must be a number") - if ($start !~ /^[0-9]+$/ || $stop !~ /^[0-9]+$/); + &usage ("codenumber must be a number between 0 and 99") + if ($start !~ /^\d\d$/ || $stop !~ /^\d\d$/); $start = sprintf("%02d", $start); $stop = sprintf("%02d", $stop); @@ -149,7 +149,7 @@ sub startstop { &usage("expected start|stop"); } - if ($ARGV[1] !~ /^[0-9]+$/) { + if ($ARGV[1] !~ /^\d\d$/) { &usage("expected NN after $ARGV[0]"); } $NN = sprintf("%02d", $ARGV[1]); -- 2.39.5