From 1fa27d58342e7f89fecd515f7690558cee0cc6d1 Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 23 Apr 2008 06:34:15 +0000 Subject: [PATCH] Added krb5 stubs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10621 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/server/events/gosaTriggered.pm | 71 ++++++++- gosa-si/tests/client.php | 200 +++++++++++++------------ 2 files changed, 167 insertions(+), 104 deletions(-) diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index f6950552c..63e7ce832 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -31,7 +31,15 @@ my @events = ( "recreate_fai_release_db", "recreate_packages_list_db", "send_user_msg", - "get_available_kernel", + "get_available_kernel", + "krb5_list_principals", + "krb5_list_policies", + "krb5_get_principal", + "krb5_set_principal", + "krb5_del_principal", + "krb5_get_policy", + "krb5_set_policy", + "krb5_del_policy", ); @EXPORT = @events; @@ -247,9 +255,6 @@ sub recreate_fai_release_db { sub recreate_packages_list_db { my ($msg, $msg_hash, $session_id) = @_ ; my $out_msg; - my $header = @{$msg_hash->{'header'}}[0]; - my $source = @{$msg_hash->{'source'}}[0]; - my $target = @{$msg_hash->{'target'}}[0]; my $jobdb_id = @{$msg_hash->{'jobdb_id'}}[0]; if( defined $jobdb_id) { @@ -258,7 +263,7 @@ sub recreate_packages_list_db { my $res = $main::job_db->exec_statement($sql_statement); } - &main::create_packages_list_db(undef,undef,undef); + &main::create_packages_list_db; my @out_msg_l = ( $out_msg ); return @out_msg_l; @@ -716,4 +721,60 @@ sub get_available_kernel { } +sub krb5_list_principals { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_set_principal { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_get_principal { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_del_principal { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_list_policies { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_get_policy { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_set_policy { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + +sub krb5_del_policy { + my ($msg, $msg_hash, $session_id) = @_; + $msg =~ s/gosa_krb5/krb5/g; + return ( $msg ); +} + + 1; diff --git a/gosa-si/tests/client.php b/gosa-si/tests/client.php index 1c40df4f6..7a92a4c0b 100755 --- a/gosa-si/tests/client.php +++ b/gosa-si/tests/client.php @@ -9,108 +9,110 @@ $zahl= 1; for($count = 1; $count <= $zahl; $count++) { -$sock = new Socket_Client("127.0.0.1","20081",TRUE,1); -$sock->setEncryptionKey("secret-gosa-password"); - -if($sock->connected()){ - /* Prepare a hunge bunch of data to be send */ - -# jobdb add -#$data = "
gosa_network_completition
GOSAGOSAws-muc-2
"; -#$data = "
job_sayHello
10.89.1.155:2008300:01:6c:9d:b9:fa00:1B:77:04:8A:6C 20130102133908
"; -#$data = "
job_ping
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa19700101000000
"; - - -# jobdb delete -#$data = "
gosa_delete_jobdb_entry
GOSA GOSA 1
"; - -# smbhash -#$data = "
gosa_gen_smb_hash
GOSAGOSAtester
"; - -# Reload ldap config -#$data = "
gosa_trigger_reload_ldap_config
GOSA00:01:6c:9d:b9:fa
"; - -# jobdb update -#$data = "
gosa_update_status_jobdb_entry
GOSA GOSA 1 19700101000000
"; -#$data = "
gosa_update_status_jobdb_entry
GOSAGOSA 00:01:6c:9d:b9:fa processing update
"; - -# jobdb query -#$data = "
gosa_query_jobdb
GOSA GOSAandgt0le5
"; -#$data = "
gosa_query_jobdb
GOSA GOSA like %0102%
"; -#$data= "
gosa_query_jobdb
GOSA GOSAping03
"; -#$data= "
gosa_query_jobdb
GOSA GOSAtrigger_action_reinstall025timestamp DESC
"; -#$data= "
gosa_query_jobdb
GOSA GOSA
"; -#$data= "
gosa_query_fai_server
GOSA GOSA
"; -#$data= "
gosa_query_fai_release
GOSA GOSA
"; -#$data= "
gosa_query_packages_list
GOSA GOSA
"; - - -# jobdb count -#$data = "
gosa_count_jobdb
GOSA GOSA
"; -#$data = "
gosa_count_fai_server
GOSA GOSA
"; -#$data = "
gosa_count_fai_release
GOSA GOSA
"; - -# jobdb clear -#$data = "
gosa_clear_jobdb
GOSA GOSA
"; - -# set gosa-si-client to 'activated' -#$data = "
job_set_activated_for_installation
10.89.1.31:20083 GOSA 00:01:6c:9d:b9:fa22220101000000
"; - - -# trigger jobs at client -#$data = "
gosa_detect_hardware
10.89.1.31:20083 10.89.1.31:20081
"; -#$data = "
gosa_new_key_for_client
00:01:6c:9d:b9:fa 10.89.1.31:20081
"; -#$data = "
job_trigger_action_wake
00:01:6c:9d:b9:fa GOSA 19700101000000
"; -#$data = "
gosa_trigger_action_faireboot
00:01:6c:9d:b9:fa GOSA
"; -#$data = "
gosa_trigger_action_reboot
00:01:6c:9d:b9:fa GOSA
"; -#$data = "
job_trigger_action_reinstall
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa 19700101000000
"; -#$data = "
job_trigger_action_instant_update
00:01:6c:9d:b9:fa GOSA 19700101000000
"; -#$data = "
gosa_ping
00:01:6c:9d:b9:fa GOSA
"; - - -# get_login_usr_for_client -#$data = "
gosa_get_login_usr_for_client
GOSA GOSA 00:01:6c:9d:b9:fa
"; - -# get_client_for_login_usr -#$data = "
gosa_get_client_for_login_usr
GOSA GOSA harald
"; - -################## -# recreate fai dbs -#$data = "
gosa_recreate_fai_server_db
GOSA GOSA
"; -$data = "
gosa_recreate_fai_release_db
GOSA GOSA
"; -#$data = "
gosa_recreate_packages_list_db
GOSA GOSA
"; - -########### -# messaging -#$data = "
gosa_send_user_msg
GOSA GOSA eine wichtige nachricht admin rettenbe 20130101235959 kaffeepause
"; - - -################ -# logHandling.pm -# all date and mac parameter accept regular expression as input unless other instructions are given -# show_log_by_mac, show_log_by_date, show_log_by_date_and_mac, show_log_files_by_date_and_mac, -# get_log_file_by_date_and_mac, delete_log_by_date_and_mac, get_recent_log_by_mac -#$data = "
gosa_show_log_by_mac
GOSA GOSA 00:01:6C:9D:B9:FA 00:01:6c:9d:b9:fb
"; -#$data = "
gosa_show_log_by_date
GOSA GOSA 20080313 20080323
"; -#$data = "
gosa_show_log_by_date_and_mac
GOSA GOSA 200803 00:01:6c:9d:b9:FA
"; -#$data = "
gosa_delete_log_by_date_and_mac
GOSA GOSA 00:01:6c:9d:b9:fa
"; -#$data = "
gosa_get_recent_log_by_mac
GOSA GOSA 00:01:6c:9d:b9:fa
"; -# exact date and mac are required as input -#$data = "
gosa_show_log_files_by_date_and_mac
GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa
"; -#$data = "
gosa_get_log_file_by_date_and_mac
GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa boot.log
"; - -######### -# testing -#$data = "
gosa_query_packages_list
GOSA GOSA
"; + $sock = new Socket_Client("127.0.0.1","20081",TRUE,1); + $sock->setEncryptionKey("secret-gosa-password"); + + if($sock->connected()){ + + /* Prepare a hunge bunch of data to be send */ + # jobdb add + #$data = "
gosa_network_completition
GOSAGOSAws-muc-2
"; + #$data = "
job_sayHello
10.89.1.155:2008300:01:6c:9d:b9:fa00:1B:77:04:8A:6C 20130102133908
"; + #$data = "
job_ping
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa19700101000000
"; + + # jobdb delete + #$data = "
gosa_delete_jobdb_entry
GOSA GOSA 1
"; + + # smbhash + #$data = "
gosa_gen_smb_hash
GOSAGOSAtester
"; + + # Reload ldap config + #$data = "
gosa_trigger_reload_ldap_config
GOSA00:01:6c:9d:b9:fa
"; + + # jobdb update + #$data = "
gosa_update_status_jobdb_entry
GOSA GOSA 1 19700101000000
"; + #$data = "
gosa_update_status_jobdb_entry
GOSAGOSA 00:01:6c:9d:b9:fa processing update
"; + + # jobdb query + #$data = "
gosa_query_jobdb
GOSA GOSAandgt0le5
"; + #$data = "
gosa_query_jobdb
GOSA GOSA like %0102%
"; + #$data= "
gosa_query_jobdb
GOSA GOSAping03
"; + #$data= "
gosa_query_jobdb
GOSA GOSAtrigger_action_reinstall025timestamp DESC
"; + #$data= "
gosa_query_jobdb
GOSA GOSA
"; + #$data= "
gosa_query_fai_server
GOSA GOSA
"; + #$data= "
gosa_query_fai_release
GOSA GOSA
"; + #$data= "
gosa_query_packages_list
GOSA GOSA
"; + + + # jobdb count + #$data = "
gosa_count_jobdb
GOSA GOSA
"; + #$data = "
gosa_count_fai_server
GOSA GOSA
"; + #$data = "
gosa_count_fai_release
GOSA GOSA
"; + + # jobdb clear + #$data = "
gosa_clear_jobdb
GOSA GOSA
"; + + # set gosa-si-client to 'activated' + #$data = "
job_set_activated_for_installation
10.89.1.31:20083 GOSA 00:01:6c:9d:b9:fa22220101000000
"; + + + # trigger jobs at client + #$data = "
gosa_detect_hardware
10.89.1.31:20083 10.89.1.31:20081
"; + #$data = "
gosa_new_key_for_client
00:01:6c:9d:b9:fa 10.89.1.31:20081
"; + #$data = "
job_trigger_action_wake
00:01:6c:9d:b9:fa GOSA 19700101000000
"; + #$data = "
gosa_trigger_action_faireboot
00:01:6c:9d:b9:fa GOSA
"; + #$data = "
gosa_trigger_action_reboot
00:01:6c:9d:b9:fa GOSA
"; + #$data = "
job_trigger_action_reinstall
GOSA 00:01:6c:9d:b9:fa 00:01:6c:9d:b9:fa 19700101000000
"; + #$data = "
job_trigger_action_instant_update
00:01:6c:9d:b9:fa GOSA 19700101000000
"; + #$data = "
gosa_ping
00:01:6c:9d:b9:fa GOSA
"; + + + # get_login_usr_for_client + #$data = "
gosa_get_login_usr_for_client
GOSA GOSA 00:01:6c:9d:b9:fa
"; + + # get_client_for_login_usr + #$data = "
gosa_get_client_for_login_usr
GOSA GOSA harald
"; + + ################## + # recreate fai dbs + #$data = "
gosa_recreate_fai_server_db
GOSA GOSA
"; + #$data = "
gosa_recreate_fai_release_db
GOSA GOSA
"; + #$data = "
gosa_recreate_packages_list_db
GOSA GOSA
"; + + ########### + # messaging + #$data = "
gosa_send_user_msg
GOSA GOSA eine wichtige nachricht admin rettenbe 20130101235959 kaffeepause
"; + + + ################ + # logHandling.pm + # all date and mac parameter accept regular expression as input unless other instructions are given + # show_log_by_mac, show_log_by_date, show_log_by_date_and_mac, show_log_files_by_date_and_mac, + # get_log_file_by_date_and_mac, delete_log_by_date_and_mac, get_recent_log_by_mac + #$data = "
gosa_show_log_by_mac
GOSA GOSA 00:01:6C:9D:B9:FA 00:01:6c:9d:b9:fb
"; + #$data = "
gosa_show_log_by_date
GOSA GOSA 20080313 20080323
"; + #$data = "
gosa_show_log_by_date_and_mac
GOSA GOSA 200803 00:01:6c:9d:b9:FA
"; + #$data = "
gosa_delete_log_by_date_and_mac
GOSA GOSA 00:01:6c:9d:b9:fa
"; + #$data = "
gosa_get_recent_log_by_mac
GOSA GOSA 00:01:6c:9d:b9:fa
"; + # exact date and mac are required as input + #$data = "
gosa_show_log_files_by_date_and_mac
GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa
"; + #$data = "
gosa_get_log_file_by_date_and_mac
GOSA GOSA install_20080311_090900 00:01:6c:9d:b9:fa boot.log
"; + + ######### + # testing + #$data = "
gosa_query_packages_list
GOSA GOSA
"; + + # Kerberos test query + $data = "
gosa_krb5_list_principals
00:0C:29:DD:CD:2A GOSA
"; $sock->write($data); $answer = "nothing"; - $answer = $sock->read(); - + $answer = $sock->read(); + echo "$count: $answer\n"; - $sock->close(); -}else{ - echo "... FAILED!\n"; -} + $sock->close(); + }else{ + echo "... FAILED!\n"; + } } ?> -- 2.30.2