This file is indexed.

config is in ldap-auth-config 0.5.3.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/perl
# Debconf configuration script for PADL-ldap tools.
# By Sami Haahtinen <ressu@debian.org>
# Modified for ldap-auth-config by Rick Clark <rick.clark@ubuntu.com>

$conffile="/etc/ldap.conf";
$action=shift;
$from_version=shift;

use Debconf::Client::ConfModule ':all';
version('2.0');

my @ret;
my @current_config;

# make sure user sees this
my $has_old_confs = "";
subst('ldap-auth-config/move-to-debconf','newfn',"$conffile");
subst('ldap-auth-config/move-to-debconf','nssfn','/etc/libnss-ldap.conf');
subst('ldap-auth-config/move-to-debconf','pamfn','/etc/pam-ldap.conf');
if (-e "/etc/libnss-ldap.conf" || -e "/etc/pam-ldap.conf") {
	fset('ldap-auth-config/move-to-debconf', 'seen', 'false');
	input('critical', 'ldap-auth-config/move-to-debconf');
	$has_old_confs = "yes";
} else {
	set('ldap-auth-config/move-to-debconf', 'true');
	fset('ldap-auth-config/move-to-debconf', 'seen', 'true');
}
$ret = go();

# The 'override' thing really ought to go, but let's see how this works
# out first.

if (not $has_old_confs) {
	if (-f $conffile) {
		open CONFIG, "<$conffile";
		if(<CONFIG> =~ /^###DEBCONF###$/) {
			set("ldap-auth-config/override", "true");
		} else {
			set("ldap-auth-config/override", "false");
		};
		# whee.. the same deal as with libnss-ldap, critical
		# priority with reconfigure otherwise it's just high
		input($action =~ /reconfigure/ ? "critical" : "high", 
			"ldap-auth-config/override");

		@current_config = <CONFIG>;
		close CONFIG;
	} else {
		# if the conffile doesn't exist, we will override the default
		set("ldap-auth-config/override", "true");
	}
};
$ret=go();

subst('ldap-auth-config/rootbindpw','filename','/etc/ldap.secret');
subst('ldap-auth-config/rootbindpw','package','ldap-auth-config');

if(get("ldap-auth-config/override") eq "true" and get("ldap-auth-config/move-to-debconf") eq "true") {
	# don't forget to check for any values of 'host' here --
	# it may be better to just prepend 'ldap://' and migrate
	# these all to URI so we can deprecate HOST, but for the time
	# being this should adequately address our needs
	my $value = (grep(/^host\s/, @current_config))[0];
	if ($value) {
		chomp($value);
		$value =~ s/^host\s+//;
		set('ldap-auth-config/ldapns/ldap-server', $value);
	}
	read_and_input('ldap-auth-config/ldapns/ldap-server', 'uri', 'critical');
	read_and_input('ldap-auth-config/ldapns/base-dn', 'base', 'critical');
	read_and_input('ldap-auth-config/ldapns/ldap_version', 'ldap_version', 'critical');
	$ret = go();  # yeah, we don't need that.. but in case we sometime do

	# dbrootlogin will most likely break.. i need to deal with it
	# someday..
	input("high", "ldap-auth-config/dbrootlogin");
	input("high", "ldap-auth-config/dblogin");
	$ret = go();

	if(get("ldap-auth-config/dbrootlogin") eq "true") {
		read_and_input('ldap-auth-config/rootbinddn', 'rootbinddn', 'critical');
		input('critical', 'ldap-auth-config/rootbindpw');
		$ret = go()
	}

	if(get("ldap-auth-config/dblogin") eq "true") {
		# user wants to login.. 
		read_and_input('ldap-auth-config/binddn', 'binddn', 'critical');
		read_and_input('ldap-auth-config/bindpw', 'bindpw', 'critical');
		$ret = go();
	}
	read_and_input('ldap-auth-config/pam_password', 'pam_password', 'medium');
	$ret = go();
}


sub read_and_input
{
	my ($debconf_name, $conffile_name, $priority) = @_;
	$priority = 'medium' unless $priority;

	my @valuelist = grep(/^$conffile_name\s/, @current_config);
	if (@valuelist) {
		my $value = pop(@valuelist);
		chomp($value);
		$value =~ s/^$conffile_name\s+//;
		set($debconf_name, $value);
	}
	input($priority, $debconf_name);
}