bugfix: supportool: Sensitive files are being included in the support dump.

Add feature to remove files that are sensitive (such as vtun configuration with passwords)
This commit is contained in:
Conrad Lara - KG6JEI 2015-05-24 13:47:16 -07:00
parent c788d2daff
commit 23b634e6ac
1 changed files with 16 additions and 0 deletions

View File

@ -50,6 +50,13 @@ use perlfunc;
"/var/run/hosts_olsr", "/var/run/hosts_olsr",
); );
@sensitive = ( "/etc/config/vtun",
"/etc/config.mesh/vtun",
"/etc/httpd.conf",
);
@cmds = ( "cat /proc/cpuinfo", @cmds = ( "cat /proc/cpuinfo",
"df -k", "df -k",
"dmesg", "dmesg",
@ -100,6 +107,15 @@ foreach $path (@files) {
} }
#Remove sensitive files
foreach $path (@sensitive) {
if ( $path =~ /^\/(.*)/ ) {
my $sourcepath = $1;
system("rm", "-r", "-f", "/tmp/sd/$sourcepath");
}
}
system("touch","/tmp/sd/data.txt"); system("touch","/tmp/sd/data.txt");
open (my $CMDS_OUT, '>', '/tmp/sd/data.txt') or die "Could not open dump file"; open (my $CMDS_OUT, '>', '/tmp/sd/data.txt') or die "Could not open dump file";