File: config

package info (click to toggle)
libnss-ldap 186-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,028 kB
  • ctags: 990
  • sloc: ansic: 9,646; sh: 2,270; perl: 129; makefile: 106
file content (70 lines) | stat: -rw-r--r-- 1,990 bytes parent folder | download
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
#!/usr/bin/perl
# Debconf configuration script for PADL-ldap tools.
# By Sami Haahtinen <ressu@debian.org>

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

use Debian::DebConf::Client::ConfModule ':all';
version('2.0');

# Not yet.. i'll prolly fix this later...
# my $capb=capb('backup');

my @ret;

if(-e $conffile) {
	open CONFIG, "<$conffile";
	if(<CONFIG> =~ /^###DEBCONF###/) {
		set("libnss-ldap/override", "true");
	} else {
		my $oldval=get("libnss-ldap/override");
		set("libnss-ldap/override", "false"); 
		if ($oldval eq "true") {
			fset("libnss-ldap/override", "seen", "false")
		}

		# well, this was a screwy from the start.. lets make it more
		# sane. priority is critical when running reconfigure, 
		# otherwise it's high.. 
		#           -- i hope thats enough..
		
		input($action =~ /reconfigure/ ? "critical" : "high", 
			"libnss-ldap/override");
		$ret=go();
	};
	close CONFIG;
} else { 
	set("libnss-ldap/override", "true");
};

# ok, previously in Configuring LDAP services.. 
#  - Configuration file was tested for ###DEBCONF### and override was
#    set accordingly.
#  - Eric was dumped because of an secret affair with Karen.
# Tune in next time for the next episode of, configuring LDAP services..

if(get("libnss-ldap/override") eq "true") {
	input("critical", "shared/ldapns/ldap-server");
	input("critical", "shared/ldapns/base-dn");
	input("critical", "shared/ldapns/ldap_version");
	$ret = go();  # yeah, we don't need that.. but in case we sometime do

	# Anyone with database that requires logging in should have 
	# atleast medium priority..
	input("medium", "libnss-ldap/dblogin");
	input("medium", "libnss-ldap/confperm");
	$ret = go();

	if(get("libnss-ldap/dblogin") eq "true") {
		# user wants to login.. 
		# we better set these at critical.. just in case
		input("critical", "libnss-ldap/binddn");
		input("critical", "libnss-ldap/bindpw");
		$ret = go();
	}
}

input("critical", "libnss-ldap/nsswitch");
$ret = go();