From 55304dcac1af0f34f31b511e44279b5126401eac Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 4 Jan 2008 09:48:48 +0000 Subject: [PATCH] Added LDAP config git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8210 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-client | 21 +++++++++------------ gosa-si/modules/ServerPackages.pm | 23 ++++++++++++++++++++++- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index 4e1369e50..29119d833 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -951,19 +951,16 @@ sub new_ldap_config { $ldap_base= $element; next; } - if ($key =~ /^ldap_/) { - my $post =~ s/^ldap_//; - push (@ldap_options, "$post $element"); + if ($key =~ /^ldap_cfg$/) { + push (@ldap_options, "$element"); next; } - if ($key =~ /^pam_/) { - my $post =~ s/^pam_//; - push (@pam_options, "$post $element"); + if ($key =~ /^pam_cfg$/) { + push (@pam_options, "$element"); next; } - if ($key =~ /^nss_/) { - my $post =~ s/^nss_//; - push (@nss_options, "$post $element"); + if ($key =~ /^nss_cfg$/) { + push (@nss_options, "$element"); next; } } @@ -980,7 +977,7 @@ sub new_ldap_config { } print file "\nBASE $ldap_base\n"; foreach $element (@ldap_options) { - print file "$element"; + print file "$element\n"; } close (file); daemon_log("wrote $ldap_config", 5); @@ -999,10 +996,10 @@ sub new_ldap_config { print file "\nbase $ldap_base\n"; print file2 "\nbase $ldap_base\n"; foreach $element (@pam_options) { - print file "$element"; + print file "$element\n"; } foreach $element (@nss_options) { - print file2 "$element"; + print file2 "$element\n"; } close (file2); daemon_log("wrote $nss_config", 5); diff --git a/gosa-si/modules/ServerPackages.pm b/gosa-si/modules/ServerPackages.pm index dc33583ad..b5fa53c44 100644 --- a/gosa-si/modules/ServerPackages.pm +++ b/gosa-si/modules/ServerPackages.pm @@ -21,6 +21,7 @@ my ($server_activ, $server_port, $server_passwd, $max_clients, $ldap_uri, $ldap_ my ($bus_activ, $bus_passwd, $bus_ip, $bus_port); my $server; my $no_bus; +my (@ldap_cfg, @pam_cfg, @nss_cfg); my %cfg_defaults = ("server" => @@ -135,6 +136,25 @@ sub read_configfile { ${@$pinfo[0]} = $cfg->val( $section, $param, @$pinfo[1] ); } } + + # Read non predefined sections + my $param; + if ($cfg->SectionExists('ldap')){ + foreach $param ($cfg->Parameters('ldap')){ + push (@ldap_cfg, "$param ".$cfg->val('ldap', $param)); + } + } + if ($cfg->SectionExists('pam_ldap')){ + foreach $param ($cfg->Parameters('pam_ldap')){ + push (@pam_cfg, "$param ".$cfg->val('pam_ldap', $param)); + } + } + if ($cfg->SectionExists('nss_ldap')){ + foreach $param ($cfg->Parameters('nss_ldap')){ + push (@nss_cfg, "$param ".$cfg->val('nss_ldap', $param)); + } + } + } @@ -586,7 +606,8 @@ sub new_ldap_config { $mesg = $ldap->unbind; # Send information - my %data = ( 'ldap_uri' => \@ldap_uris, 'ldap_base' => $base ); + my %data = ( 'ldap_uri' => \@ldap_uris, 'ldap_base' => $base, + 'ldap_cfg' => \@ldap_cfg, 'pam_cfg' => \@pam_cfg,'nss_cfg' => \@nss_cfg ); send_msg("new_ldap_config", $server_address, $address, \%data); return; -- 2.30.2