Merge in SNORT/snort3 from ~NIRMVENK/snort3:fix_error to master
Squashed commit of the following:
commit
47e879770de81b34013c58c66f73713bbb2dcb42
Author: Nirmala Subbaiah <nirmvenk@cisco.com>
Date: Fri Mar 21 13:24:01 2025 -0400
packet_capture: use existing util function to check directory path
#include "capture_module.h"
-#include <filesystem>
#include <lua.hpp>
#include "control/control.h"
bool is_path_valid(const std::string& path)
{
- if ( !std::filesystem::exists(path) )
+ if ( !is_directory_path(path) )
{
WarningMessage("Cannot create pcap at %s; directory does not exist\n", path.c_str());
return false;
return true;
}
+namespace snort
+{
bool is_directory_path(const std::string& path)
{
struct STAT sb;
return ISDIR(sb.st_mode);
}
-namespace snort
-{
const char* get_error(int errnum)
{
static THREAD_LOCAL char buf[128];
unsigned int get_random_seed();
bool get_file_size(const std::string&, size_t&);
-bool is_directory_path(const std::string&);
namespace
{
SO_PUBLIC bool rotate_file_for_max_size(const char* file_owner, const char* old_file,
FILE* old_fh, uint32_t max_file_size);
SO_PUBLIC bool check_file_size(FILE* fh, uint64_t max_file_size);
+SO_PUBLIC bool is_directory_path(const std::string&);
}
#endif