auth_ldap=LDAP client configuration file,8
pam_ldap=PAM LDAP configuration file,3,Same as LDAP client file
-secret=Root LDAP client password file,8
+secret=Root LDAP client password files,9,50,2,\t
line0=LDAP browser and validation settings,11
ldap_hosts=LDAP server hosts,3,From config file,50
ldap_port=LDAP server port,3,From config file,5
# Returns the password used when the root user connects to the LDAP server
sub get_rootbinddn_secret
{
-&open_readfile(SECRET, $config{'secret'}) || return undef;
+local @secrets = split(/\t+/, $config{'secret'});
+&open_readfile(SECRET, $secrets[0]) || return undef;
local $secret = <SECRET>;
close(SECRET);
$secret =~ s/\r|\n//g;
# Saves the password used when the root user connects to the LDAP server
sub save_rootbinddn_secret
{
+local @secrets = split(/\t+/, $config{'secret'});
if (defined($_[0])) {
- &open_tempfile(SECRET, ">$config{'secret'}");
- &print_tempfile(SECRET, $_[0],"\n");
- &close_tempfile(SECRET);
- &set_ownership_permissions(0, 0, 0600, $config{'secret'});
+ foreach my $secret (@secrets) {
+ &open_tempfile(SECRET, ">$secret");
+ &print_tempfile(SECRET, $_[0],"\n");
+ &close_tempfile(SECRET);
+ &set_ownership_permissions(0, 0, 0600, $secret);
+ }
}
else {
- &unlink_file($config{'secret'});
+ &unlink_file(@secrets);
}
}
&ReadParse();
&lock_file($config{'auth_ldap'});
-&lock_file($config{'secret'});
+@secrets = split(/\t+/, $config{'secret'});
+foreach $secret (@secrets) {
+ &lock_file($secret);
+ }
$conf = &get_config();
$uri = &find_svalue("uri", $conf);
# Write out config
&flush_file_lines();
&unlock_file($config{'auth_ldap'});
-&unlock_file($config{'secret'});
+foreach $secret (@secrets) {
+ &unlock_file($secret);
+ }
&webmin_log("server");
&redirect("");