From 9e470a6708514046a15909b833910e1aa4915fef Mon Sep 17 00:00:00 2001 From: rettenbe Date: Mon, 22 Oct 2007 09:50:10 +0000 Subject: [PATCH] =?utf8?q?=C3=84nderung=20von=20add=5Fldap=5Fentry()=20und?= =?utf8?q?=20change=5Fldap=5Fentry()=20zu=20&search=5Fldap=5Fentry($ldap?= =?utf8?q?=5Ftree,=20$ldap=5Fbase,=20"(|(macAddress=3D$mac)(dhcpHWAddress?= =?utf8?q?=3Dethernet=20$mac))")?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7618 594d385d-05f5-0310-b6e9-bd551577e9d8 --- contrib/daemon/gosa-sd | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/contrib/daemon/gosa-sd b/contrib/daemon/gosa-sd index 78e4fd939..3db6576aa 100755 --- a/contrib/daemon/gosa-sd +++ b/contrib/daemon/gosa-sd @@ -40,7 +40,7 @@ my ($ldap, $bind_phrase, $password, $ldap_base) ; $procid = -1 ; $foreground = 0 ; $verbose = 0 ; -$max_process = 1 ; +$max_process = 2 ; $max_process_timeout = 1 ; $ldap_base = "dc=gonicus,dc=de" ; #$ldap_path = "/var/run/gosa-support-daemon.socket"; @@ -318,8 +318,7 @@ sub open_fifo { sub add_ldap_entry { my ($ldap_tree, $ldap_base, $mac, $gotoSysStatus, $ip, $interface, $desc) = @_; my $dn = "cn=$mac,ou=incoming,$ldap_base"; - - my $s_res = &search_ldap_entry($ldap_tree, $ldap_base, "(macAddress=$mac)"); + my $s_res = &search_ldap_entry($ldap_tree, $ldap_base, "(|(macAddress=$mac)(dhcpHWAddress=ethernet $mac))"); my $c_res = $s_res->count; if($c_res == 1) { daemon_log("WARNING: macAddress $mac already in LDAP", 1); @@ -370,7 +369,7 @@ sub change_ldap_entry { my ($ldap_tree, $ldap_base, $mac, $gotoSysStatus ) = @_; # check if ldap_entry exists or not - my $s_res = &search_ldap_entry($ldap_tree, $ldap_base, "(macAddress=$mac)"); + my $s_res = &search_ldap_entry($ldap_tree, $ldap_base, "(|(macAddress=$mac)(dhcpHWAddress=ethernet $mac))"); my $c_res = $s_res->count; if($c_res == 0) { daemon_log("WARNING: macAddress $mac not in LDAP", 1); @@ -449,8 +448,6 @@ if( not -p $fifo_path ) { die "fifo file disappeared\n" } sysopen(FIFO, $fifo_path, O_RDONLY) or die "can't read from $fifo_path: $!" ; while( 1 ) { - # wenn FIFO nicht offen, dann öffne ihn - # checke alle prozesse im hash daemon_children ob sie noch aktiv sind, wenn # nicht, dann entferne prozess aus hash while( (my $key, my $val) = each( %daemon_children) ) { @@ -556,7 +553,6 @@ while( 1 ) { # ldap add - sleep( 1 ) ; $ldap->unbind; exit; } -- 2.30.2