summaryrefslogtreecommitdiff
path: root/debian/local/pam-auth-update
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2008-09-06 01:04:59 -0700
committerSteve Langasek <steve.langasek@ubuntu.com>2019-01-03 17:28:27 -0800
commitb5fc8e3cd5277c8f7cac99bf006d14d7906eb01c (patch)
tree924ec2032fafdcbe0fba0f8f5583c228e6a89efb /debian/local/pam-auth-update
parenta24ae5c1b8c5c7c4a0dcfcd80b75148c0ea5d756 (diff)
drop '-Final' from all of the field names, but support these field names for
backwards compatibility
Diffstat (limited to 'debian/local/pam-auth-update')
-rwxr-xr-xdebian/local/pam-auth-update11
1 files changed, 7 insertions, 4 deletions
diff --git a/debian/local/pam-auth-update b/debian/local/pam-auth-update
index 829833b8..3989f9f6 100755
--- a/debian/local/pam-auth-update
+++ b/debian/local/pam-auth-update
@@ -299,7 +299,7 @@ sub create_from_template
$output = $profiles->{$mod}{$uctype . '-Initial'};
$i++;
} else {
- $output = $profiles->{$mod}{$uctype . '-Final'};
+ $output = $profiles->{$mod}{$uctype};
}
# bypasses a perl warning about @_, sigh
my @tmparr = split("\n+",$output);
@@ -322,7 +322,7 @@ sub create_from_template
$output = $profiles->{$mod}{$uctype . '-Initial'};
$i++;
} else {
- $output = $profiles->{$mod}{$uctype . '-Final'};
+ $output = $profiles->{$mod}{$uctype};
}
for my $line (split("\n",$output)) {
$line = merge_one_line($line,$diff,
@@ -459,7 +459,7 @@ sub write_profiles
$output = $profiles->{$mod}{$uctype . '-Initial'};
$i++;
} else {
- $output = $profiles->{$mod}{$uctype . '-Final'};
+ $output = $profiles->{$mod}{$uctype};
}
if ($output) {
print OUTPUT "Module: $mod\n";
@@ -611,12 +611,15 @@ sub parse_pam_profile
while (<PROFILE>) {
if (/^(\S+):\s+(.*)$/) {
$fieldname = $1;
+ # compatibility with the first implementation round;
+ # "Auth-Final" is now just called "Auth"
+ $fieldname =~ s/-Final$//;
if ($fieldname eq 'Conflicts') {
foreach my $elem (split(/, /, $2)) {
$profile{'Conflicts'}->{$elem} = 1;
}
} else {
- $profile{$1} = $2;
+ $profile{$fieldname} = $2;
}
} else {
chomp;