revert file path display relative path #623

This commit is contained in:
DastInDark
2022-07-18 21:55:04 +09:00
parent 00cd26eaeb
commit b97de6b588

View File

@@ -254,19 +254,13 @@ impl Detection {
} else { } else {
None None
}; };
let conf = configs::CONFIG.read().unwrap();
let abs_rule_path = &PathBuf::from(&rule.rulepath) let abs_rule_path = &PathBuf::from(&rule.rulepath)
.canonicalize() .canonicalize()
.unwrap() .unwrap()
.display() .display()
.to_string()[4..]; .to_string()[4..];
let file_opt_path = if conf.args.filepath.is_some() {
conf.args.filepath.as_ref().unwrap()
} else {
conf.args.directory.as_ref().unwrap()
};
let detect_info = DetectInfo { let detect_info = DetectInfo {
filepath: get_output_str_path(file_opt_path, Path::new(&record_info.evtx_filepath)), filepath: record_info.evtx_filepath.to_string(),
rulepath: get_output_str_path( rulepath: get_output_str_path(
&configs::CONFIG.read().unwrap().args.rules, &configs::CONFIG.read().unwrap().args.rules,
Path::new(abs_rule_path), Path::new(abs_rule_path),