summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 706fd31)
raw | patch | inline | side by side (parent: 706fd31)
author | lhm-gosa <lhm-gosa@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 10 Feb 2009 12:55:02 +0000 (12:55 +0000) | ||
committer | lhm-gosa <lhm-gosa@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 10 Feb 2009 12:55:02 +0000 (12:55 +0000) |
* Fix base stripping, when it contains regexp characters
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13419 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13419 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/modules/ClientPackages.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 1bf9728c3d09c4af3c3c5260ea5b54e5b9a47952..e9fe6ed78a58d69af3ebcfc0226e8ca1c2425702 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
attrs => [],
filter => "(&(objectClass=organizationalUnit)(ou=fai))",
);
- if($mesg->{'resultCode'} == 0 &&
- $mesg->count != 0) {
+ if(($mesg->code == 0) && ($mesg->count != 0))
+ {
+ daemon_log("$session_id DEBUG: create_fai_release_db: count " . $mesg->count,8);
+
# Walk through all possible FAI container ou's
my @sql_list;
my $timestamp= &get_time();
}
}
- daemon_log("$session_id DEBUG: Inserting ".scalar @sql_list." entries to DB",8);
+ daemon_log("$session_id DEBUG: create_fai_release_db: Inserting ".scalar @sql_list." entries to DB",8);
if(@sql_list) {
unshift @sql_list, "VACUUM";
unshift @sql_list, "DELETE FROM $table_name";
$fai_release_db->exec_statementlist(\@sql_list);
}
- daemon_log("$session_id DEBUG: Done with inserting",7);
+ daemon_log("$session_id DEBUG: create_fai_release_db: Done with inserting",7);
+ } else {
+ daemon_log("$session_id INFO: create_fai_release_db: error: " . $mesg->code ,5);
}
daemon_log("$session_id INFO: create_fai_release_db: finished",5);
}
foreach my $entry (@{$mesg->{entries}}) {
if($entry->exists('cn')) {
my $tmp_dn= $entry->dn();
+ $tmp_dn= substr( $tmp_dn, 0, length($tmp_dn)
+ - length($fai_base) - 1 );
# Skip classname and ou dn parts for class
- my $tmp_release = ($1) if $tmp_dn =~ /^[^,]+,[^,]+,(.*?),$fai_base$/;
+ my $tmp_release = ($1) if $tmp_dn =~ /^[^,]+,[^,]+,(.*?)$/;
# Skip classes without releases
if((!defined($tmp_release)) || length($tmp_release)==0) {
}
} elsif (!$entry->exists('cn')) {
my $tmp_dn= $entry->dn();
- my $tmp_release = ($1) if $tmp_dn =~ /^(.*?),$fai_base$/;
+ $tmp_dn= substr( $tmp_dn, 0, length($tmp_dn)
+ - length($fai_base) - 1 );
+ my $tmp_release = ($1) if $tmp_dn =~ /^(.*?)$/;
# Skip classes without releases
if((!defined($tmp_release)) || length($tmp_release)==0) {
unlink($dest);
daemon_log("$session_id DEBUG: delete file '$dest'", 5);
} else {
- daemon_log("$session_id ERROR: create_packages_list_db: get_packages: fetching '$url' failed!", 1);
+ daemon_log("$session_id ERROR: create_packages_list_db: get_packages: fetching '$url' into '$dest' failed!", 1);
}
return 0;
}
index e5f24ff339668484f95258ff60de4b4abd24f719..08c8689357e994930ba38f38eac978b39723abd0 100644 (file)
}
my $entry= $ldap_res->entry(0);
- my $dn = &Net::LDAP::Util::escape_dn_value($entry->dn);
+ my $filter_dn = &Net::LDAP::Util::escape_filter_value($entry->dn);
my $syslog_server = $entry->get_value("gotoSyslogServer");
# If no syslog server is specified at host, just have a look at the object group of the host
my $ldap_res = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['gotoSyslogServer'],
- filter => "(&(objectClass=gosaGroupOfNames)(member=$dn))");
+ filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
return;
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: gotoSyslogServer".
- "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$dn))", 1);
+ "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
return;
}
&main::daemon_log("$session_id WARNING: no syslog server specified for this host '$mac_address'", 3);
return;
}
+
# Add syslog server to 'syslog_config' message
my $syslog_msg_hash = &create_xml_hash("new_syslog_config", $server_address, $mac_address);
}
my $entry= $ldap_res->entry(0);
- my $dn = &Net::LDAP::Util::escape_dn_value($entry->dn);
+ my $filter_dn = &Net::LDAP::Util::escape_filter_value($entry->dn);
my @ntp_servers= $entry->get_value("gotoNtpServer");
# If no ntp server is specified at host, just have a look at the object group of the host
my $ldap_res = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['gotoNtpServer'],
- filter => "(&(objectClass=gosaGroupOfNames)(member=$dn))");
+ filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
return;
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: gotoNtpServer".
- "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$dn))", 1);
+ "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
return;
}
}
my $entry= $mesg->entry(0);
- my $dn= $entry->dn;
+ my $filter_dn= &Net::LDAP::Util::escape_filter_value($entry->dn);
my @servers= $entry->get_value("gotoLdapServer");
my $unit_tag= $entry->get_value("gosaUnitTag");
my @ldap_uris;
my $server;
my $base;
my $release;
+ my $dn= $entry->dn;
# Fill release if available
my $FAIclass= $entry->get_value("FAIclass");
# Do we need to look at an object class?
if (not @servers){
- my $escaped_dn = &Net::LDAP::Util::escape_dn_value($dn);
$mesg = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['dn', 'gotoLdapServer', 'FAIclass'],
- filter => "(&(objectClass=gosaGroupOfNames)(member=$escaped_dn))");
+ filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($mesg->code) {
- &main::daemon_log("$session_id ERROR: unable to search for '(&(objectClass=gosaGroupOfNames)(member=$dn))': ".$mesg->error, 1);
+ &main::daemon_log("$session_id ERROR: unable to search for '(&(objectClass=gosaGroupOfNames)(member=$filter_dn))': ".$mesg->error, 1);
return;
}
"\n\tbase: $ldap_base".
"\n\tscope: sub".
"\n\tattrs: dn, gotoLdapServer, FAIclass".
- "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$escaped_dn))", 1);
+ "\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
return;
}
} else {
my $entry= $mesg->entry(0);
- my $dn= $entry->dn;
if (defined($entry->get_value("gotoHardwareChecksum"))) {
if (! $entry->get_value("gotoHardwareChecksum") eq $gotoHardwareChecksum) {
$entry->replace(gotoHardwareChecksum => $gotoHardwareChecksum);