From 0a5e369b193edee69135bceab93e567ba64c522c Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Thu, 28 Jun 2012 16:48:15 +0000 Subject: [PATCH] SecurityCheck fixes git-svn-id: https://svn.fhem.de/fhem/trunk@1661 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_telnet.pm | 2 +- fhem/fhem.pl | 9 +++++++-- fhem/webfrontend/pgm2/01_FHEMWEB.pm | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/98_telnet.pm b/fhem/FHEM/98_telnet.pm index 58f5ee6cf..f53b83ec2 100644 --- a/fhem/FHEM/98_telnet.pm +++ b/fhem/FHEM/98_telnet.pm @@ -37,7 +37,7 @@ telnet_SecurityCheck($$) AttrVal($_, "globalpassword", undef)) } devspec2array("TYPE=telnet"); $motd .= (join(",", sort @list). - " has no password/globalpassword attribute\n") + " has no password/globalpassword attribute.\n") if(@list); $attr{global}{motd} = $motd; } diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 6a5d2313d..1f18a4d34 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -369,15 +369,20 @@ $attr{global}{motd} = "$sc_text\n\n" $init_done = 1; DoTrigger("global", "INITIALIZED"); +$attr{global}{motd} .= "Running with root privileges." + if($^O !~ m/Win/ && $< == 0); $attr{global}{motd} .= - "\nRestart fhem for a new check if the problem ist fixed,\n". + "\nRestart fhem for a new check if the problem is fixed,\n". "or set the global attribute motd to none to supress this message.\n" if($attr{global}{motd} =~ m/^$sc_text\n\n./); my $motd = $attr{global}{motd}; if($motd eq "$sc_text\n\n") { delete($attr{global}{motd}); } else { - Log 2, $motd if($motd ne "none"); + if($motd ne "none") { + $motd =~ s/\n/ /g; + Log 2, $motd; + } } Log 0, "Server started (version $attr{global}{version}, pid $$)"; diff --git a/fhem/webfrontend/pgm2/01_FHEMWEB.pm b/fhem/webfrontend/pgm2/01_FHEMWEB.pm index ff7543d87..8beb9dcc3 100755 --- a/fhem/webfrontend/pgm2/01_FHEMWEB.pm +++ b/fhem/webfrontend/pgm2/01_FHEMWEB.pm @@ -121,7 +121,7 @@ FW_SecurityCheck($$) if($motd =~ "^SecurityCheck") { my @list = grep { !AttrVal($_, "basicAuth", undef) } devspec2array("TYPE=FHEMWEB"); - $motd .= (join(",", sort @list)." has no basicAuth attribute\n") + $motd .= (join(",", sort @list)." has no basicAuth attribute.\n") if(@list); $attr{global}{motd} = $motd; }