summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 06cc247)
raw | patch | inline | side by side (parent: 06cc247)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jan 2008 16:56:43 +0000 (16:56 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jan 2008 16:56:43 +0000 (16:56 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8199 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-client | patch | blob | history | |
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-client b/gosa-si/gosa-si-client
index 141aa3e1d80b3262db6ebd05e912a4db76c92cea..b261e3d8c4ccd51f2eac29388a1bef2c75db35eb 100755 (executable)
--- a/gosa-si/gosa-si-client
+++ b/gosa-si/gosa-si-client
#
# FILE: gosa-server
#
-# USAGE: ./gosasc
+# USAGE: gosa-si-client
#
# DESCRIPTION:
#
my ($cfg_file, %cfg_defaults, $foreground, $verbose, $pid_file, $procid, $pid, $log_file);
my ($server_address, $server_ip, $server_port, $server_domain, $server_passwd, $server_cipher, $server_timeout);
-my ($client_address, $client_ip, $client_port, $client_mac_address);
+my ($client_address, $client_ip, $client_port, $client_mac_address, $ldap_config, $pam_config, $nss_config);
my ($input_socket, $rbits, $wbits, $ebits, $xml, $known_hosts);
my (@events);
# default variables
-my $event_dir = "/etc/gosac/events";
+my $event_dir = "/etc/gosa-si/client/events";
$known_hosts = {};
$foreground = 0 ;
%cfg_defaults =
},
"client" =>
{"client_port" => [\$client_port, "20083"],
+ "ldap_config" => [\$ldap_config, "/etc/ldap/ldap.conf"],
+ "pam_config" => [\$pam_config, "/etc/pam_ldap.conf"],
+ "nss_config" => [\$nss_config, "/etc/libnss_ldap.conf"],
},
"server" =>
{"server_ip" => [\$server_ip, ""],
# detect all client accepted events
opendir(DIR, $event_dir)
- or daemon_log("cannot find directory $event_dir!\ngosac starts without any accepting events!", 1);
+ or daemon_log("cannot find directory $event_dir!\ngosa-si-client starts without any accepting events!", 1);
my $file_name;
@events = ();
while(defined($file_name = readdir(DIR))){
sub new_ldap_config {
my ($msg_hash) = @_ ;
+ my $element;
+ my @ldap_uris;
+ my $ldap_base;
+ my @ldap_options;
+ my @pam_options;
+ my @nss_options;
+
+ # Transform input into array
+ while ( my ($key, $value) = each(%$msg_hash) ) {
+ if ($key =~ /^(source|target|header)$/) {
+ next;
+ }
+
+ foreach $element (@$value) {
+ if ($key =~ /^ldap_uri$/) {
+ push (@ldap_uris, $element);
+ next;
+ }
+ if ($key =~ /^ldap_base$/) {
+ $ldap_base= $element;
+ next;
+ }
+ if ($key =~ /^ldap_/) {
+ my $post =~ s/^ldap_//;
+ push (@ldap_options, "$post $element");
+ next;
+ }
+ if ($key =~ /^pam_/) {
+ my $post =~ s/^pam_//;
+ push (@pam_options, "$post $element");
+ next;
+ }
+ if ($key =~ /^nss_/) {
+ my $post =~ s/^nss_//;
+ push (@nss_options, "$post $element");
+ next;
+ }
+ }
+ }
- my @gotoLdapServer = &get_content_from_xml_hash($msg_hash, "new_ldap_config");
- print Dumper @gotoLdapServer;
-
+ # Setup ldap.conf
+ my $file;
+ my $file2;
+ open(file, "> $ldap_config");
+ print file "# This file was automatically generated by gosa-si-client. Do not change.\n";
+ print file "URI";
+ foreach $element (@ldap_uris) {
+ print file " $element";
+ }
+ print file "\nBASE $ldap_base\n";
+ foreach $element (@ldap_options) {
+ print file "$element";
+ }
+ close (file);
+ daemon_log("wrote $ldap_config", 5);
+
+ # Setup pam_ldap.conf / libnss_ldap.conf
+ open(file, "> $pam_config");
+ open(file2, "> $nss_config");
+ print file "# This file was automatically generated by gosa-si-client. Do not change.\n";
+ print file2 "# This file was automatically generated by gosa-si-client. Do not change.\n";
+ print file "uri";
+ print file2 "uri";
+ foreach $element (@ldap_uris) {
+ print file " $element";
+ print file2 " $element";
+ }
+ print file "\nbase $ldap_base\n";
+ foreach $element (@pam_options) {
+ print file "$element";
+ }
+ foreach $element (@nss_options) {
+ print file2 "$element";
+ }
+ close (file2);
+ daemon_log("wrote $nss_config", 5);
+ close (file);
+ daemon_log("wrote $pam_config", 5);
return;
sub execute_event {
my ($msg_hash)= @_;
- my $configdir= '/etc/gosac/events/';
+ my $configdir= '/etc/gosa-si/client/events/';
my $result;
my $header = &get_content_from_xml_hash($msg_hash, 'header');
if((not defined $source)
&& (not defined $target)
&& (not defined $header)) {
- daemon_log("ERROR: Entries missing in XML msg for gosa events under /etc/gosac/events");
+ daemon_log("ERROR: Entries missing in XML msg for gosa events under $configdir");
} else {
my $parameters="";
my @params = &get_content_from_xml_hash($msg_hash, $header);
index d6a7f004480910fea67ad88e7028fd77cb9cb7fb..bc5458af4a1d4d88e49e4bfb01d8395f579bbea2 100644 (file)
use Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(create_xml_hash send_msg_hash2address get_content_from_xml_hash add_content2xml_hash create_xml_string encrypt_msg decrypt_msg create_ciphering transform_msg2hash);
+@EXPORT = qw(create_xml_hash send_msg_hash2address get_content_from_xml_hash add_content2xml_hash create_xml_string encrypt_msg decrypt_msg create_ciphering transform_msg2hash send_msg);
use strict;
use warnings;