mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
make sure there aren't any trailing spaces in paths or we could accidentally maybe perhaps rm -r / or similar wrong directories
git-svn-id: http://www.observium.org/svn/observer/trunk@1500 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@ -254,7 +254,7 @@ function delete_port($int_id)
|
||||
mysql_query("DELETE FROM `bill_ports` WHERE `port_id` = '$int_id'");
|
||||
mysql_query("DELETE from `pseudowires` WHERE `interface_id` = '$int_id'");
|
||||
mysql_query("DELETE FROM `ports` WHERE `interface_id` = '$int_id'");
|
||||
shell_exec("rm -rf ".$config['rrd_dir']."/".$interface['hostname']."/".$interface['ifIndex'].".rrd");
|
||||
shell_exec("rm -rf ".trim($config['rrd_dir'])."/".trim($interface['hostname'])."/".$interface['ifIndex'].".rrd");
|
||||
}
|
||||
|
||||
function delete_device($id)
|
||||
@ -286,7 +286,7 @@ function delete_device($id)
|
||||
mysql_query("DELETE FROM `frequency` WHERE `device_id` = '$id'");
|
||||
mysql_query("DELETE FROM `current` WHERE `device_id` = '$id'");
|
||||
mysql_query("DELETE FROM `sensors` WHERE `device_id` = '$id'");
|
||||
shell_exec("rm -rf ".$config['rrd_dir']."/$host");
|
||||
shell_exec("rm -rf ".trim($config['rrd_dir'])."/$host");
|
||||
return $ret . "Removed device $host\n";
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user