Исправлены ошибки при добавлении ИБ

Реализованы процедуры добавления элементов профиля безопасности
This commit is contained in:
Sergey Kalinin 2018-07-20 06:50:00 +03:00
parent 07dd503666
commit 4dfa7e2a66

View File

@ -658,25 +658,25 @@ proc Run::rule {tree host values} {
} }
proc Run::directory {tree host values} { proc Run::directory {tree host values} {
Run::acl $tree $host $values directory Run::acl $host $values directory
} }
proc Run::com {tree host values} { proc Run::com {tree host values} {
Run::acl $tree $host $values com Run::acl $host $values com
} }
proc Run::addin {tree host values} { proc Run::addin {tree host values} {
Run::acl $tree $host $values addin Run::acl $host $values addin
} }
proc Run::module {tree host values} { proc Run::module {tree host values} {
Run::acl $tree $host $values module Run::acl $host $values module
} }
proc Run::app {tree host values} { proc Run::app {tree host values} {
Run::acl $tree $host $values app Run::acl $host $values app
} }
proc Run::inet {tree host values} { proc Run::inet {tree host values} {
Run::acl $tree $host $values inet Run::acl $host $values inet
} }
proc Run::acl {tree host values mode} { proc Run::acl {host values mode} {
global active_cluster cluster_user cluster_pwd profile_name global active_cluster cluster_user cluster_pwd profile_name
if {$cluster_user ne "" && $cluster_pwd ne ""} { if {$cluster_user ne "" && $cluster_pwd ne ""} {
set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd" set auth "--cluster-user=$cluster_user --cluster-pwd=$cluster_pwd"
@ -1028,7 +1028,7 @@ proc Add::infobases {tree host values} {
--locale=[.add.frm.ent_locale get] \ --locale=[.add.frm.ent_locale get] \
--db-user=[.add.frm.ent_db_user get] \ --db-user=[.add.frm.ent_db_user get] \
--db-pwd=[.add.frm.ent_db_pwd get] \ --db-pwd=[.add.frm.ent_db_pwd get] \
--descr=\"[.add.frm.ent_descr get]\" \ --descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "] \
--date-offset=$date_offset \ --date-offset=$date_offset \
--security-level=$security_level \ --security-level=$security_level \
--scheduled-jobs-deny=$scheduled_jobs_deny \ --scheduled-jobs-deny=$scheduled_jobs_deny \
@ -1264,7 +1264,7 @@ proc Add::profile {tree host values} {
RunCommand "profile update \ RunCommand "profile update \
--cluster=$active_cluster $auth \ --cluster=$active_cluster $auth \
--name=[.add.frm.ent_name get] \ --name=[.add.frm.ent_name get] \
--descr=[.add.frm.ent_descr get] \ --descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "] \
--config=$config \ --config=$config \
--priv=$priv \ --priv=$priv \
--crypto=$crypto \ --crypto=$crypto \
@ -1317,12 +1317,12 @@ proc Add::directory {tree host values} {
.add.frm_btn.btn_ok configure -command { .add.frm_btn.btn_ok configure -command {
RunCommand "profile acl directory update \ RunCommand "profile --cluster=$active_cluster $auth \
--cluster=$active_cluster $auth \ acl --name=$profile_name \
--name=$profile_name \ directory update \
--alias=[.add.frm.ent_alias get] \ \"--alias=[regsub -all -- " " [.add.frm.ent_alias get] "\\ "]\" \
--descr=[.add.frm.ent_descr get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--physicalPath=[.add.frm.ent_descr get] \ \"--physicalPath=[regsub -all -- " " [.add.frm.ent_physicalPath get] "\\ "]\" \
--allowedRead=$allowedRead \ --allowedRead=$allowedRead \
--allowedWrite=$allowedWrite \ --allowedWrite=$allowedWrite \
$host" $host"
@ -1361,11 +1361,11 @@ proc Add::addin {tree host values} {
grid $frm.ent_hash -row 2 -column 1 -sticky nw -padx 5 -pady 5 grid $frm.ent_hash -row 2 -column 1 -sticky nw -padx 5 -pady 5
.add.frm_btn.btn_ok configure -command { .add.frm_btn.btn_ok configure -command {
RunCommand "profile acl addin update \ RunCommand "profile --cluster=$active_cluster $auth \
--cluster=$active_cluster $auth \ acl --name=$profile_name \
--name=$profile_name \ addin update \
--name=[.add.frm.ent_name get] \ \"--name=[regsub -all -- " " [.add.frm.ent_name get] "\\ "]\" \
--descr=[.add.frm.ent_descr get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--hash=[.add.frm.ent_hash get] \ --hash=[.add.frm.ent_hash get] \
$host" $host"
Run::addin $tree $host $profile_name Run::addin $tree $host $profile_name
@ -1402,11 +1402,11 @@ proc Add::module {tree host values} {
grid $frm.ent_hash -row 2 -column 1 -sticky nw -padx 5 -pady 5 grid $frm.ent_hash -row 2 -column 1 -sticky nw -padx 5 -pady 5
.add.frm_btn.btn_ok configure -command { .add.frm_btn.btn_ok configure -command {
RunCommand "profile acl module update \ RunCommand "profile --cluster=$active_cluster $auth \
--cluster=$active_cluster $auth \ acl --name=$profile_name \
--name=$profile_name \ module update \
--name=[.add.frm.ent_name get] \ \"--name=[regsub -all -- " " [.add.frm.ent_name get] "\\ "]\" \
--descr=[.add.frm.ent_descr get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--hash=[.add.frm.ent_hash get] \ --hash=[.add.frm.ent_hash get] \
$host" $host"
Run::module $tree $host $profile_name Run::module $tree $host $profile_name
@ -1452,12 +1452,11 @@ proc Add::com {tree host values} {
.add.frm_btn.btn_ok configure -command { .add.frm_btn.btn_ok configure -command {
RunCommand "profile acl com update \ RunCommand "profile --cluster=$active_cluster $auth \
--cluster=$active_cluster $auth \ acl --name=$profile_name com update \
--name=$profile_name \ \"--name=[regsub -all -- " " [.add.frm.ent_name get] "\\ "]\" \
--name=[.add.frm.ent_name get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--descr=[.add.frm.ent_descr get] \ \"--fileName=[regsub -all -- " " [.add.frm.ent_fileName get] "\\ "]\" \
--fileName=[.add.frm.ent_fileName get] \
--id=[.add.frm.ent_id get] \ --id=[.add.frm.ent_id get] \
--host=[.add.frm.ent_host get] \ --host=[.add.frm.ent_host get] \
$host" $host"
@ -1495,12 +1494,11 @@ proc Add::app {tree host values} {
grid $frm.ent_wild -row 2 -column 1 -sticky nw -padx 5 -pady 5 grid $frm.ent_wild -row 2 -column 1 -sticky nw -padx 5 -pady 5
.add.frm_btn.btn_ok configure -command { .add.frm_btn.btn_ok configure -command {
RunCommand "profile acl app update \ RunCommand "profile --cluster=$active_cluster $auth \
--cluster=$active_cluster $auth \ acl --name=$profile_name app update \
--name=$profile_name \ \"--name=[regsub -all -- " " [.add.frm.ent_name get] "\\ "]\" \
--name=[.add.frm.ent_name get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--descr=[.add.frm.ent_descr get] \ \"--wild=[regsub -all -- " " [.add.frm.ent_wild get] "\\ "]\" \
--wild=[.add.frm.ent_wild get] \
$host" $host"
Run::app $tree $host $profile_name Run::app $tree $host $profile_name
destroy .add destroy .add
@ -1528,7 +1526,7 @@ proc Add::inet {tree host values} {
label $frm.lbl_protocol -justify left -anchor nw -text "Протокол" label $frm.lbl_protocol -justify left -anchor nw -text "Протокол"
entry $frm.ent_protocol entry $frm.ent_protocol
label $frm.lbl_url -justify left -anchor nw -text "Адрес (URL)" label $frm.lbl_url -justify left -anchor nw -text "Адрес (URL)"
entry $frm.url entry $frm.ent_url
label $frm.lbl_port -justify left -anchor nw -text "Порт" label $frm.lbl_port -justify left -anchor nw -text "Порт"
entry $frm.ent_port entry $frm.ent_port
$frm.ent_port insert end 0 $frm.ent_port insert end 0
@ -1546,13 +1544,12 @@ proc Add::inet {tree host values} {
.add.frm_btn.btn_ok configure -command { .add.frm_btn.btn_ok configure -command {
RunCommand "profile acl inet update \ RunCommand "profile --cluster=$active_cluster $auth \
--cluster=$active_cluster $auth \ acl --name=$profile_name inet update \
--name=$profile_name \ \"--name=[regsub -all -- " " [.add.frm.ent_name get] "\\ "]\" \
--name=[.add.frm.ent_name get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--descr=[.add.frm.ent_descr get] \
--protocol=[.add.frm.ent_protocol get] \ --protocol=[.add.frm.ent_protocol get] \
--url=[.add.frm.ent_url get] \ \"--url=[regsub -all -- " " [.add.frm.ent_url get] "\\ "]\" \
--port=[.add.frm.ent_port get] \ --port=[.add.frm.ent_port get] \
$host" $host"
Run::inet $tree $host $profile_name Run::inet $tree $host $profile_name
@ -1892,7 +1889,7 @@ proc Edit::profile {tree host values} {
RunCommand "profile update \ RunCommand "profile update \
--cluster=$active_cluster $auth \ --cluster=$active_cluster $auth \
--name=[.add.frm.ent_name get] \ --name=[.add.frm.ent_name get] \
--descr=[.add.frm.ent_descr get] \ \"--descr=[regsub -all -- " " [.add.frm.ent_descr get] "\\ "]\" \
--config=$config \ --config=$config \
--priv=$priv \ --priv=$priv \
--crypto=$crypto \ --crypto=$crypto \
@ -1909,6 +1906,7 @@ proc Edit::profile {tree host values} {
proc Edit::profiles {tree host values} { proc Edit::profiles {tree host values} {
return return
} }
proc Del {} { proc Del {} {
global active_cluster host global active_cluster host
set tree .frm_tree.tree set tree .frm_tree.tree
@ -2196,7 +2194,7 @@ proc Del::acl {host type name profile_name} {
-icon question -type yesno ] -icon question -type yesno ]
switch -- $answer { switch -- $answer {
yes { yes {
set lst [RunCommand "profile acl $type remove $item --cluster=$active_cluster --name=$profile_name $auth $host"] set lst [RunCommand "profile --cluster=$active_cluster acl --name=$profile_name $type remove $item $auth $host"]
#.frm_tree.tree delete "profile::$values" #.frm_tree.tree delete "profile::$values"
.frm_work.tree_work delete [ .frm_work.tree_work children {}] .frm_work.tree_work delete [ .frm_work.tree_work children {}]
Run::$type .frm_tree.tree $host $active_cluster Run::$type .frm_tree.tree $host $active_cluster
@ -2226,3 +2224,4 @@ proc Del::inet {tree host profile_name} {