2
# Debconf configuration script for PADL-ldap tools.
3
# By Sami Haahtinen <ressu@debian.org>
5
$conffile="/etc/libnss-ldap.conf";
9
use Debconf::Client::ConfModule ':all';
12
# Not yet.. i'll prolly fix this later...
13
# my $capb=capb('backup');
18
# The 'override' thing really ought to go, but let's see how this works
22
open CONFIG, "<$conffile";
23
if(<CONFIG> =~ /^###DEBCONF###$/) {
24
set("libnss-ldap/override", "true");
26
my $oldval=get("libnss-ldap/override");
27
set("libnss-ldap/override", "false");
28
if ($oldval eq "true") {
29
fset("libnss-ldap/override", "seen", "false")
32
# well, this was a screwy from the start.. lets make it more
33
# sane. priority is critical when running reconfigure,
34
# otherwise it's high..
35
# -- i hope thats enough..
37
input($action =~ /reconfigure/ ? "critical" : "high",
38
"libnss-ldap/override");
41
@current_config = <CONFIG>;
44
set("libnss-ldap/override", "true");
47
# ok, previously in Configuring LDAP services..
48
# - Configuration file was tested for ###DEBCONF### and override was
50
# - Eric was dumped because of an secret affair with Karen.
51
# Tune in next time for the next episode of, configuring LDAP services..
53
if(get("libnss-ldap/override") eq "true") {
54
read_and_input('shared/ldapns/ldap-server', 'uri', 'critical');
55
read_and_input('shared/ldapns/base-dn', 'base', 'critical');
56
read_and_input('shared/ldapns/ldap_version', 'ldap_version', 'critical');
57
$ret = go(); # yeah, we don't need that.. but in case we sometime do
59
# Anyone with database that requires logging in should have
60
# atleast medium priority..
61
input("medium", "libnss-ldap/dblogin");
62
input("medium", "libnss-ldap/dbrootlogin");
63
input("medium", "libnss-ldap/confperm");
66
if(get("libnss-ldap/dbrootlogin") eq "true") {
67
read_and_input('libnss-ldap/rootbinddn', 'rootbinddn', 'critical');
68
input('critical', 'libnss-ldap/rootbindpw');
72
if(get("libnss-ldap/dblogin") eq "true") {
73
# user wants to login..
74
# we better set these at critical.. just in case
75
read_and_input('libnss-ldap/binddn', 'binddn', 'critical');
76
read_and_input('libnss-ldap/bindpw', 'bindpw', 'critical');
81
input("critical", "libnss-ldap/nsswitch");
86
my ($debconf_name, $conffile_name, $priority) = @_;
87
$priority = 'medium' unless $priority;
89
my @valuelist = grep(/^$conffile_name\s/, @current_config);
91
my $value = pop(@valuelist);
93
$value =~ s/^$conffile_name\s+//;
94
set($debconf_name, $value);
96
input($priority, $debconf_name);