From: cajus Date: Thu, 21 Feb 2008 14:18:31 +0000 (+0000) Subject: Added gen_smb_hash X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=acb4ea12d09e06dc0486d83096b0ae83c9ccc18a;p=gosa.git Added gen_smb_hash git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9022 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/debian/control b/gosa-si/debian/control index 562e14678..b80c2aea2 100644 --- a/gosa-si/debian/control +++ b/gosa-si/debian/control @@ -18,7 +18,7 @@ Description: GOsa support infrastructure Package: gosa-si-server Architecture: any -Depends: gosa-si-common +Depends: gosa-si-common, libcrypt-smbhash-perl Suggests: gosa Description: GOsa support infrastructure server This package provides everything you need in order to deploy a simple diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 23dae9f51..a041a7229 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -3,6 +3,7 @@ use Exporter; @ISA = qw(Exporter); my @events = ( "get_events", + "gen_smb_hash", "ping", "network_completition", "set_activated_for_installation", @@ -24,6 +25,7 @@ my @events = ( use strict; use warnings; use GOSA::GosaSupportDaemon; +use Crypt::SmbHash; use Net::ARP; use Net::Ping; use Socket; @@ -41,6 +43,7 @@ sub get_events { return \@events; } + sub ping { my ($msg, $msg_hash, $session_id) = @_ ; my $source = @{$msg_hash->{source}}[0]; @@ -53,6 +56,18 @@ sub ping { return @out_msg_l; } + +sub gen_smb_hash { + my ($msg, $msg_hash, $session_id) = @_ ; + my $source = @{$msg_hash->{source}}[0]; + my $target = @{$msg_hash->{target}}[0]; + my $password = @{$msg_hash->{password}}[0]; + + my %data= ('hash' => join(q[:], ntlmgen $password)); + my $out_msg = &build_msg("gen_smb_hash", $target, 'GOSA', \%data ); +} + + sub network_completition { my ($msg, $msg_hash, $session_id) = @_ ; my $source = @{$msg_hash->{source}}[0]; @@ -79,6 +94,7 @@ sub network_completition { return ( $out_msg ); } + sub detect_hardware { my ($msg, $msg_hash) = @_ ; # just forward msg to client, but dont forget to split off 'gosa_' in header @@ -109,6 +125,7 @@ sub set_activated_for_installation { return @out_msg_l; } + sub trigger_action_localboot { my ($msg, $msg_hash) = @_; $msg =~ s/
gosa_trigger_action_localboot<\/header>/
trigger_action_localboot<\/header>/; @@ -116,6 +133,7 @@ sub trigger_action_localboot { return @out_msg_l; } + sub trigger_action_halt { my ($msg, $msg_hash) = @_; $msg =~ s/
gosa_trigger_action_halt<\/header>/
trigger_action_halt<\/header>/; @@ -172,7 +190,6 @@ sub trigger_action_sysinfo { } - sub new_key_for_client { my ($msg, $msg_hash) = @_; $msg =~ s/
gosa_new_key_for_client<\/header>/
new_key<\/header>/; @@ -180,6 +197,7 @@ sub new_key_for_client { return @out_msg_l; } + sub trigger_action_rescan { my ($msg, $msg_hash) = @_; $msg =~ s/
gosa_trigger_action_rescan<\/header>/
trigger_action_rescan<\/header>/; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 42d1f7a63..2c31f9cbb 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -23,8 +23,11 @@ if($sock->connected()){ # delete #$data = "
gosa_delete_jobdb_entry
3
"; +# smbhash +$data = "
gosa_gen_smb_hash
GOSAGOSAtester
"; + # update -$data = "
gosa_update_status_jobdb_entry
GOSAGOSA waiting processing update
"; +#$data = "
gosa_update_status_jobdb_entry
GOSAGOSA waiting processing update
"; # query #$data = "
gosa_query_jobdb
andgt0le5
";