summaryrefslogtreecommitdiff
path: root/debian/local
diff options
context:
space:
mode:
Diffstat (limited to 'debian/local')
-rwxr-xr-xdebian/local/pam-auth-update25
1 files changed, 18 insertions, 7 deletions
diff --git a/debian/local/pam-auth-update b/debian/local/pam-auth-update
index acfb4002..1a1a452d 100755
--- a/debian/local/pam-auth-update
+++ b/debian/local/pam-auth-update
@@ -38,8 +38,9 @@ my $overridetemplate = 'libpam-runtime/override';
my $blanktemplate = 'libpam-runtime/no_profiles_chosen';
my $confdir = '/etc/pam.d';
my $savedir = '/var/lib/pam';
-my (%profiles, @sorted, @enabled, @conflicts, %removals);
+my (%profiles, @sorted, @enabled, @conflicts, @new, %removals);
my $force = 0;
+my $package = 0;
my $priority = 'high';
my %md5sums = (
'auth' => ['8d4fe17e66ba25de16a117035d1396aa'],
@@ -79,17 +80,19 @@ while ($#ARGV >= 0) {
if ($opt eq '--force') {
$force = 1;
} elsif ($opt eq '--package') {
- $priority = 'medium';
+ $package = 1;
} elsif ($opt eq '--remove') {
while ($#ARGV >= 0) {
last if ($ARGV[0] =~ /^--/);
$removals{shift @ARGV} = 1;
}
# --remove implies --package
- $priority = 'medium' if (keys(%removals));
+ $package = 1 if (keys(%removals));
}
}
+$priority = 'medium' if ($package);
+
x_loadtemplatefile('/var/lib/dpkg/info/libpam-runtime.templates','libpam-runtime');
# always sort by priority, so we have consistency and don't have to
@@ -141,9 +144,9 @@ push(@enabled,
my $prev = '';
@enabled = grep { $_ ne $prev && (($prev) = $_) } @enabled;
-
-fset($template,'seen','false');
-set($template,join(', ', @enabled));
+# Do we have any new options to show? If not, we shouldn't reprompt the
+# user, at any priority level, unless explicitly called.
+@new = grep { !$seen{$_} } @sorted;
# if diff_profiles() fails, and we weren't passed a 'force' argument
# (because this isn't an upgrade from an old version, or the checksum
@@ -170,6 +173,12 @@ umask(0022);
do {
@conflicts = ();
+
+ if (@new || !$package) {
+ fset($template,'seen','false');
+ }
+ set($template,join(', ', @enabled));
+
input($priority,$template);
go();
@@ -194,10 +203,12 @@ do {
subst($errtemplate, 'conflicts', join("\n", @conflicts));
input('high',$errtemplate);
}
- fset($template,'seen','false');
set($template, join(', ', @enabled));
if (!@enabled) {
input('high',$blanktemplate);
+ # we can only end up here by user error, but give them another
+ # shot at selecting a correct config anyway.
+ fset($template,'seen','false');
}
} while (@conflicts || !@enabled);