summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f0f6e77)
raw | patch | inline | side by side (parent: f0f6e77)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jul 2008 09:01:18 +0000 (09:01 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jul 2008 09:01:18 +0000 (09:01 +0000) |
closes #477
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11519 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11519 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/gosa-si-server | patch | blob | history | |
gosa-si/modules/GosaSupportDaemon.pm | patch | blob | history |
diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server
index 4c4df6b605e2450557345e8be92173070f3c9225..a73ca11c6ade9300b7de9f7867e5ff5eaffd7bba 100755 (executable)
--- a/gosa-si/gosa-si-server
+++ b/gosa-si/gosa-si-server
@@ -2984,11 +2984,8 @@ daemon_log("0 INFO: found foreign server in config file and DNS: $all_foreign_se
my $act_timestamp = &get_time();
foreach my $foreign_server (@foreign_server_list) {
- #######################################
- # TODO for jan
# do not add myself to known_server_db
- # work around!!!
- if ($foreign_server eq '10.89.1.31:20081') { next; }
+ if (&is_local($foreign_server)) { next; }
######################################
my $res = $known_server_db->add_dbentry( {table=>$known_server_tn,
index e5da00754d74c02bd5947b4cef8936cfdc6cf761..21db30a5974acedb2677887fe3bb5df3828f0b34 100644 (file)
"get_ip",
"get_interface_for_ip",
"get_interfaces",
- "run_as",
+ "is_local",
+ "run_as",
);
@EXPORT = @functions;
use strict;
}
+#=== FUNCTION ================================================================
+# NAME: is_local
+# PARAMETERS: Server Address
+# RETURNS: true if Server Address is on this host, false otherwise
+# DESCRIPTION: Checks all interface addresses, stops on first match
+#===============================================================================
+sub is_local {
+ my $server_address = shift || "";
+ my $result = 0;
+
+ my $server_ip = $1 if $server_address =~ /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d{1,6}$/;
+
+ if(defined($server_ip) && length($server_ip) > 0) {
+ foreach my $interface(&get_interfaces()) {
+ my $ip_address= &get_ip($interface);
+ if($ip_address eq $server_ip) {
+ $result = 1;
+ last;
+ }
+ }
+ }
+
+ return $result;
+}
+
+
#=== FUNCTION ================================================================
# NAME: run_as
# PARAMETERS: uid, command