Merge "security feature: Enhance HTTPD password security" into develop

This commit is contained in:
KG6JEI 2016-06-16 05:39:10 +00:00 committed by Gerrit Code Review
commit ae6688dc33
4 changed files with 14 additions and 34 deletions

View File

@ -26,7 +26,6 @@
/etc/firewall.user /etc/firewall.user
/etc/group /etc/group
/etc/hosts /etc/hosts
/etc/httpd.conf
/etc/gridsquare /etc/gridsquare
/etc/latlon /etc/latlon
/etc/local/services /etc/local/services

View File

@ -1,6 +1,6 @@
/cgi-bin/setup:root:hsmm /cgi-bin/setup:root:$p$root
/cgi-bin/ports:root:hsmm /cgi-bin/ports:root:$p$root
/cgi-bin/admin:root:hsmm /cgi-bin/admin:root:$p$root
/cgi-bin/vpn:root:hsmm /cgi-bin/vpn:root:$p$root
/cgi-bin/vpnc:root:hsmm /cgi-bin/vpnc:root:$p$root
/cgi-bin/supporttool:root:hsmm /cgi-bin/supporttool:root:$p$root

26
files/etc/uci-defaults/40_aredn_migrate-httpdconf Normal file → Executable file
View File

@ -1,20 +1,10 @@
#!/bin/sh #!/bin/sh
IFS=" cat > /etc/httpd.conf <<'EOF'
" /cgi-bin/setup:root:$p$root
/cgi-bin/ports:root:$p$root
addedpaths="/cgi-bin/vpn /cgi-bin/admin:root:$p$root
/cgi-bin/vpnc /cgi-bin/vpn:root:$p$root
/cgi-bin/supporttool /cgi-bin/vpnc:root:$p$root
" /cgi-bin/supporttool:root:$p$root
EOF
currentpwd=$(grep "/cgi-bin/setup" /etc/httpd.conf |cut -d ':' -f 3)
for protectedpath in $addedpaths
do
if grep -q "$protectedpath" "/etc/httpd.conf"; then
continue
fi
echo "$protectedpath:root:$currentpwd" >> /etc/httpd.conf
done

View File

@ -47,13 +47,4 @@ $pw2 = $pw;
$pw2 =~ s/'/'\\''/g; $pw2 =~ s/'/'\\''/g;
system "{ echo '$pw2'; sleep 1; echo '$pw2'; } | passwd > /dev/null\n"; system "{ echo '$pw2'; sleep 1; echo '$pw2'; } | passwd > /dev/null\n";
@web = `cat /etc/httpd.conf`;
open(FILE, ">/etc/httpd.conf") or die;
foreach(@web)
{
s/^(.*:root:)(.*)$/$1$pw/;
print FILE $_;
}
close(FILE);
print STDERR "passwords changed.\n"; print STDERR "passwords changed.\n";