2 # Save the LDAP search base
4 require './ldap-client-lib.pl';
5 &error_setup($text{'base_err'});
8 &lock_file($config{'auth_ldap'});
11 # Validate and save inputs, starting with global base
12 $in{'base'} =~ /\S/ || &error($text{'base_ebase'});
13 &save_directive($conf, "base", $in{'base'});
16 &save_directive($conf, "scope", $in{'scope'} || undef);
19 if ($in{'timelimit_def'}) {
20 &save_directive($conf, "timelimit", undef);
23 $in{'timelimit'} =~ /^\d+$/ || &error($text{'base_etimelimit'});
24 &save_directive($conf, "timelimit", $in{'timelimit'});
27 # Save per-service bases
28 foreach $b (@base_types) {
29 if ($in{"base_".$b."_def"}) {
30 &save_directive($conf, "nss_base_".$b, undef);
33 local $base = $in{"base_".$b};
34 $base =~ /\S/ || &error($text{'base_e'.$b});
35 if ($in{'scope_'.$b}) {
36 $base .= "?".$in{'scope_'.$b};
38 if ($in{'filter_'.$b}) {
39 $base .= "?" if ($in{'scope_'.$b});
40 $file .= "?".$in{'filter_'.$b};
42 &save_directive($conf, "nss_base_".$b, $base);
48 &unlock_file($config{'auth_ldap'});