summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 77921cb)
raw | patch | inline | side by side (parent: 77921cb)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 15 Jul 2008 15:12:21 +0000 (15:12 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 15 Jul 2008 15:12:21 +0000 (15:12 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11667 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/modules/ArpHandler.pm | patch | blob | history | |
gosa-si/modules/ClientPackages.pm | patch | blob | history | |
gosa-si/server/events/siTriggered.pm | patch | blob | history |
index 8d9f6f556963f47f6131534aab2f7f87fffaa359..f8ab3610761459a1bdc32e6ffbdab2c70c77e513 100644 (file)
# create LDAP entry
my $entry = Net::LDAP::Entry->new( $dn );
$entry->dn($dn);
- $entry->add("objectClass" => "goHard");
+ $entry->add("objectClass" => "GOhard");
$entry->add("cn" => $hosts_database->{$mac}->{cn});
$entry->add("macAddress" => $mac);
if(defined $gotoSysStatus) {$entry->add("gotoSysStatus" => $gotoSysStatus)}
index 8d4b7e805fb482cc227fdbd5841138a50c759ced..dfd104a05b3a42efed03ceaf2a2ef7c4d6b6f05f 100644 (file)
my $key_lifetime = @{$msg_hash->{key_lifetime}}[0];
# Move forced hostname to heap - if used
- #if ( defined($msg_hash->{'force-hostname'}[0]) &&
- # length($msg_hash->{'force-hostname'}[0]) > 0){
+ #FIXME: move to some global POE namespace - please
+ if ( defined($msg_hash->{'force-hostname'}[0]) &&
+ length($msg_hash->{'force-hostname'}[0]) > 0){
# $heap->{force-hostname}->{$mac_address}= $msg_hash->{'force-hostname'}[0];
- #} else {
+ open (TFILE, ">/var/tmp/$mac_address");
+ print TFILE $msg_hash->{'force-hostname'}[0];
+ close (TFILE);
+ } else {
# $heap->{force-hostname}->{$mac_address}= undef;
- #}
+ if ( -e "/var/tmp/$mac_address") {
+ unlink("/var/tmp/$mac_address")
+ };
+ }
# number of known clients
my $nu_clients= $main::known_clients_db->count_dbentries('known_clients');
index e1635269adcc77c1f73b15eaedb86e5a14aa29f2..ef0eb439890de44771373598b3a35fb703b55035 100644 (file)
&main::daemon_log("INFO: Need to create a new LDAP Entry for client $address", 4);
my $ipaddress= $1 if $address =~ /^([0-9\.]*?):.*$/;
my $dnsname;
+ #FIXME: like in ClientPackages!
#if ( defined($heap->{force-hostname}->{$macaddress}) ){
# $dnsname= $heap->{force-hostname}->{$macaddress};
# &main::daemon_log("INFO: Using forced hostname $dnsname for client $address", 4);
- #} else {
+ if (-e "/var/tmp/$macaddress" ){
+ open(TFILE, "< /var/tmp/$macaddress");
+ $dnsname= <TFILE>;
+ close(TFILE);
+ } else {
$dnsname= gethostbyaddr(inet_aton($ipaddress), AF_INET) || $ipaddress;
- #}
+ }
my $cn = (($dnsname =~ /^(\d){1,3}\.(\d){1,3}\.(\d){1,3}\.(\d){1,3}/) ? $dnsname : sprintf "%s", $dnsname =~ /([^\.]+)\.?/);
my $dn = "cn=$cn,ou=incoming,$ldap_base";
&main::daemon_log("INFO: Creating entry for $dn",5);
my $entry= Net::LDAP::Entry->new( $dn );
$entry->dn($dn);
- $entry->add("objectClass" => "goHard");
+ $entry->add("objectClass" => "GOhard");
$entry->add("cn" => $cn);
$entry->add("macAddress" => $macaddress);
$entry->add("gotomode" => "locked");