aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/hyperscan_tools.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver/hyperscan_tools.cxx')
-rw-r--r--src/libserver/hyperscan_tools.cxx15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/libserver/hyperscan_tools.cxx b/src/libserver/hyperscan_tools.cxx
index dc0586107..f7bd78a9b 100644
--- a/src/libserver/hyperscan_tools.cxx
+++ b/src/libserver/hyperscan_tools.cxx
@@ -147,22 +147,11 @@ public:
fpath = std::filesystem::canonical(fpath, ec);
- if (!ec) {
+ if (!ec && ec.value() != 0) {
msg_err_hyperscan("invalid path: \"%s\", error message: %s", fname, ec.message().c_str());
return;
}
- if (fpath.empty()) {
- msg_err_hyperscan("attempt to add an empty hyperscan file!");
- return;
- }
-
- if (!std::filesystem::exists(fpath)) {
- msg_err_hyperscan("attempt to add non existing hyperscan file: %s, %s", fpath.c_str(),
- strerror(errno));
- return;
- }
-
auto dir = fpath.parent_path();
auto ext = fpath.extension();
@@ -188,7 +177,7 @@ public:
fpath = std::filesystem::canonical(fpath, ec);
- if (!ec) {
+ if (!ec && ec.value() != 0) {
msg_err_hyperscan("invalid path to remove: \"%s\", error message: %s",
fname, ec.message().c_str());
return;