SecurityCheck fixes
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1661 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -37,7 +37,7 @@ telnet_SecurityCheck($$)
|
|||||||
AttrVal($_, "globalpassword", undef)) }
|
AttrVal($_, "globalpassword", undef)) }
|
||||||
devspec2array("TYPE=telnet");
|
devspec2array("TYPE=telnet");
|
||||||
$motd .= (join(",", sort @list).
|
$motd .= (join(",", sort @list).
|
||||||
" has no password/globalpassword attribute\n")
|
" has no password/globalpassword attribute.\n")
|
||||||
if(@list);
|
if(@list);
|
||||||
$attr{global}{motd} = $motd;
|
$attr{global}{motd} = $motd;
|
||||||
}
|
}
|
||||||
|
|||||||
9
fhem.pl
9
fhem.pl
@@ -369,15 +369,20 @@ $attr{global}{motd} = "$sc_text\n\n"
|
|||||||
$init_done = 1;
|
$init_done = 1;
|
||||||
DoTrigger("global", "INITIALIZED");
|
DoTrigger("global", "INITIALIZED");
|
||||||
|
|
||||||
|
$attr{global}{motd} .= "Running with root privileges."
|
||||||
|
if($^O !~ m/Win/ && $< == 0);
|
||||||
$attr{global}{motd} .=
|
$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"
|
"or set the global attribute motd to none to supress this message.\n"
|
||||||
if($attr{global}{motd} =~ m/^$sc_text\n\n./);
|
if($attr{global}{motd} =~ m/^$sc_text\n\n./);
|
||||||
my $motd = $attr{global}{motd};
|
my $motd = $attr{global}{motd};
|
||||||
if($motd eq "$sc_text\n\n") {
|
if($motd eq "$sc_text\n\n") {
|
||||||
delete($attr{global}{motd});
|
delete($attr{global}{motd});
|
||||||
} else {
|
} 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 $$)";
|
Log 0, "Server started (version $attr{global}{version}, pid $$)";
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ FW_SecurityCheck($$)
|
|||||||
if($motd =~ "^SecurityCheck") {
|
if($motd =~ "^SecurityCheck") {
|
||||||
my @list = grep { !AttrVal($_, "basicAuth", undef) }
|
my @list = grep { !AttrVal($_, "basicAuth", undef) }
|
||||||
devspec2array("TYPE=FHEMWEB");
|
devspec2array("TYPE=FHEMWEB");
|
||||||
$motd .= (join(",", sort @list)." has no basicAuth attribute\n")
|
$motd .= (join(",", sort @list)." has no basicAuth attribute.\n")
|
||||||
if(@list);
|
if(@list);
|
||||||
$attr{global}{motd} = $motd;
|
$attr{global}{motd} = $motd;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user