From: cajus Date: Wed, 30 Jan 2008 15:52:56 +0000 (+0000) Subject: Fixed problems with variable types X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=448b69451cf9a47b4ed3ce0e5ef23af678224915;p=gosa.git Fixed problems with variable types git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8675 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client index d3a47578d..d88988cef 100755 --- a/gosa-si/gosa-si-client +++ b/gosa-si/gosa-si-client @@ -24,6 +24,7 @@ use Getopt::Long; use Config::IniFiles; use POSIX; use Time::HiRes qw( gettimeofday ); +use File::Basename; use Fcntl; use IO::Socket::INET; @@ -1080,7 +1081,7 @@ sub new_ldap_config { my $goto_secret; my $admin_base= ""; my $department= ""; - my $unit_tag= ""; + my $unit_tag; # Transform input into array while ( my ($key, $value) = each(%$msg_hash) ) { @@ -1133,7 +1134,7 @@ sub new_ldap_config { } # Unit tagging enabled? - if ($unit_tag != ""){ + if (defined $unit_tag){ push (@pam_options, "pam_filter gosaUnitTag=$unit_tag"); push (@nss_options, "nss_base_passwd $admin_base?sub?gosaUnitTag=$unit_tag"); push (@nss_options, "nss_base_group $admin_base?sub?gosaUnitTag=$unit_tag"); @@ -1191,14 +1192,18 @@ sub new_ldap_config { daemon_log("wrote /etc/goto/secret", 5); } + + # Write shell based config - open(file1, "> /etc/ldap/ldap-shell.conf"); + my $cfg_name= dirname($ldap_config)."/ldap-shell.conf"; + open(file1, "> $cfg_name"); print file1 "LDAP_BASE=\"$ldap_base\"\n"; print file1 "ADMIN_BASE=\"$admin_base\"\n"; print file1 "DEPARTMENT=\"$department\"\n"; - print file1 "UNIT_TAG=\"$unit_tag\"\n"; - print file1 "UNIT_TAG_FILTER=\"".($unit_tag!="" ? "(gosaUnitTag=$unit_tag)" : "")."\"\n"; + print file1 "UNIT_TAG=\"".(defined $unit_tag ? "$unit_tag" : "")."\"\n"; + print file1 "UNIT_TAG_FILTER=\"".(defined $unit_tag ? "(gosaUnitTag=$unit_tag)" : "")."\"\n"; close(file1); + daemon_log("wrote $cfg_name", 5); return;