aboutsummaryrefslogtreecommitdiff
path: root/debian/local
diff options
context:
space:
mode:
authorSam Hartman <hartmans@debian.org>2021-02-25 14:59:52 -0500
committerSteve Langasek <steve.langasek@canonical.com>2021-09-15 17:52:36 -0700
commit1244a0330f47d2ff43d4d5652241f2b071bc3b2a (patch)
treef20d81b68134bc9990fd6e2ff878a95b946b7b90 /debian/local
parent5580a437c37d76f78fe6fe410c9918f8f017ee8e (diff)
downloadpam-1244a0330f47d2ff43d4d5652241f2b071bc3b2a.tar.gz
pam-1244a0330f47d2ff43d4d5652241f2b071bc3b2a.tar.bz2
pam-1244a0330f47d2ff43d4d5652241f2b071bc3b2a.zip
debian/local/pam-auth-update: detect pam_tally
Create a mechanism for tracking modules that have been removed. Disable profiles containing those modules so they do not appear in the list of available modules. Use this mechanism for pam_tally.
Diffstat (limited to 'debian/local')
-rw-r--r--debian/local/pam-auth-update7
1 files changed, 7 insertions, 0 deletions
diff --git a/debian/local/pam-auth-update b/debian/local/pam-auth-update
index 6d17ab72..62d31101 100644
--- a/debian/local/pam-auth-update
+++ b/debian/local/pam-auth-update
@@ -59,11 +59,15 @@ my %md5sums = (
'ad2b78ce1498dd637ef36469430b6ac6',
],
);
+my @invalid_modules = ('pam_tally');
opendir(DIR, $inputdir) || die "could not open config directory: $!";
while (my $profile = readdir(DIR)) {
next if ($profile eq '.' || $profile eq '..' || $profile =~ m/~$/ || $profile =~ m/^#.+#$/);
%{$profiles{$profile}} = parse_pam_profile($inputdir . '/' . $profile);
+ if (defined $profiles{$profile}{'disabled'} and $profiles{$profile}{'disabled'}) {
+ delete $profiles{$profile};
+ }
}
closedir DIR;
@@ -702,6 +706,9 @@ sub parse_pam_profile
s/^\s+//;
s/\s+$//;
$profile{$fieldname} .= "\n$_" if ($_);
+ if (grep { $profile{$fieldname} =~ /$_/} @invalid_modules) {
+ $profile{'disabled'} = 1;
+ }
$profile{$fieldname} =~ s/^[\n\s]+//;
}
}