mirror of
https://github.com/openwrt/packages.git
synced 2026-10-22 19:17:31 +04:00
strongswan: rework syslog facility levels in swanctl init
The auth syslog block only logs ike, cfg, asn and tls. chd, enc and esp are not logged there any more; they are only part of the daemon block. Also change how the levels are written to the charon syslog config: - config_get now defaults every level to "0" instead of an empty string. - All levels are always written out. The '[ "$x" = "" ] ||' guards are removed, so an unset option results in an explicit level 0 instead of no line at all. Tidy up the code in config_charon_plugin_syslog(): - Move the cfg, asn and tls declarations and config_get calls from the daemon section to the auth section. - Sort the local variables, config_get calls and swan_xappend3 calls alphabetically in both sections. Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
1 parent
194ce7f2a6
commit
c842467f98
1 file changed
+40
-40
@@ -789,58 +789,58 @@ config_shunt() {
|
||||
|
||||
config_charon_plugin_syslog() {
|
||||
# daemon syslog facility
|
||||
local dmn mgr job cfg knl net asn lib tls tnc imc imv pts app wch
|
||||
config_get dmn "syslog" dmn ""
|
||||
config_get mgr "syslog" mgr ""
|
||||
config_get job "syslog" job ""
|
||||
config_get cfg "syslog" cfg ""
|
||||
config_get knl "syslog" knl ""
|
||||
config_get net "syslog" net ""
|
||||
config_get asn "syslog" asn ""
|
||||
config_get lib "syslog" lib ""
|
||||
config_get tls "syslog" tls ""
|
||||
config_get tnc "syslog" tnc ""
|
||||
config_get imc "syslog" imc ""
|
||||
config_get imv "syslog" imv ""
|
||||
config_get pts "syslog" pts ""
|
||||
config_get app "syslog" app ""
|
||||
config_get wch "syslog" wch ""
|
||||
local app chd dmn enc esp imc imv job knl lib mgr net pts tnc wch
|
||||
config_get app "syslog" app "0"
|
||||
config_get chd "syslog" chd "0"
|
||||
config_get dmn "syslog" dmn "0"
|
||||
config_get enc "syslog" enc "0"
|
||||
config_get esp "syslog" esp "0"
|
||||
config_get imc "syslog" imc "0"
|
||||
config_get imv "syslog" imv "0"
|
||||
config_get job "syslog" job "0"
|
||||
config_get knl "syslog" knl "0"
|
||||
config_get lib "syslog" lib "0"
|
||||
config_get mgr "syslog" mgr "0"
|
||||
config_get net "syslog" net "0"
|
||||
config_get pts "syslog" pts "0"
|
||||
config_get tnc "syslog" tnc "0"
|
||||
config_get wch "syslog" wch "0"
|
||||
|
||||
# auth syslog facility
|
||||
local ike chd enc esp
|
||||
config_get ike "syslog" ike ""
|
||||
config_get chd "syslog" chd ""
|
||||
config_get enc "syslog" enc ""
|
||||
config_get esp "syslog" esp ""
|
||||
local asn cfg ike tls
|
||||
config_get asn "syslog" asn "0"
|
||||
config_get cfg "syslog" cfg "0"
|
||||
config_get ike "syslog" ike "0"
|
||||
config_get tls "syslog" tls "0"
|
||||
|
||||
swan_xappend1 "syslog {"
|
||||
swan_xappend2 "identifier = ipsec"
|
||||
swan_xappend2 "daemon {"
|
||||
swan_xappend3 "default = -1"
|
||||
swan_xappend3 "ike_name = yes"
|
||||
[ "$dmn" = "" ] || swan_xappend3 "dmn = $dmn"
|
||||
[ "$mgr" = "" ] || swan_xappend3 "mgr = $mgr"
|
||||
[ "$job" = "" ] || swan_xappend3 "job = $job"
|
||||
[ "$cfg" = "" ] || swan_xappend3 "cfg = $cfg"
|
||||
[ "$knl" = "" ] || swan_xappend3 "knl = $knl"
|
||||
[ "$net" = "" ] || swan_xappend3 "net = $net"
|
||||
[ "$asn" = "" ] || swan_xappend3 "asn = $asn"
|
||||
[ "$lib" = "" ] || swan_xappend3 "lib = $lib"
|
||||
[ "$tls" = "" ] || swan_xappend3 "tls = $tls"
|
||||
[ "$tnc" = "" ] || swan_xappend3 "tnc = $tnc"
|
||||
[ "$imc" = "" ] || swan_xappend3 "imc = $imc"
|
||||
[ "$imv" = "" ] || swan_xappend3 "imv = $imv"
|
||||
[ "$pts" = "" ] || swan_xappend3 "pts = $pts"
|
||||
[ "$app" = "" ] || swan_xappend3 "app = $app"
|
||||
[ "$wch" = "" ] || swan_xappend3 "wch = $wch"
|
||||
swan_xappend3 "app = $app"
|
||||
swan_xappend3 "chd = $chd"
|
||||
swan_xappend3 "dmn = $dmn"
|
||||
swan_xappend3 "enc = $enc"
|
||||
swan_xappend3 "esp = $esp"
|
||||
swan_xappend3 "imc = $imc"
|
||||
swan_xappend3 "imv = $imv"
|
||||
swan_xappend3 "job = $job"
|
||||
swan_xappend3 "knl = $knl"
|
||||
swan_xappend3 "lib = $lib"
|
||||
swan_xappend3 "mgr = $mgr"
|
||||
swan_xappend3 "net = $net"
|
||||
swan_xappend3 "pts = $pts"
|
||||
swan_xappend3 "tnc = $tnc"
|
||||
swan_xappend3 "wch = $wch"
|
||||
swan_xappend2 "}"
|
||||
swan_xappend2 "auth {"
|
||||
swan_xappend3 "default = -1"
|
||||
swan_xappend3 "ike_name = yes"
|
||||
[ "$ike" = "" ] || swan_xappend3 "ike = $ike"
|
||||
[ "$chd" = "" ] || swan_xappend3 "chd = $chd"
|
||||
[ "$enc" = "" ] || swan_xappend3 "enc = $enc"
|
||||
[ "$esp" = "" ] || swan_xappend3 "esp = $esp"
|
||||
swan_xappend3 "asn = $asn"
|
||||
swan_xappend3 "cfg = $cfg"
|
||||
swan_xappend3 "ike = $ike"
|
||||
swan_xappend3 "tls = $tls"
|
||||
swan_xappend2 "}"
|
||||
swan_xappend1 "}"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user