Skip to content
API Documentation
BastionGuard™
SambaPage.cpp File Reference

Go to the source code of this file.

Functions

static bool clamdscan_running ()
static bool samba_temp_exists ()

Function Documentation

◆ clamdscan_running()

bool clamdscan_running ( )
static

Definition at line 37 of file SambaPage.cpp.

38{
39 return ((bg_process::run({"pgrep", "-f", "clamdscan"}).exit_code) == 0);
40}
Result run(const std::vector< std::string > &args, bool merge_stderr=false, std::size_t limit=8U *1024U *1024U, const std::map< std::string, std::string > &environment={}, const std::function< bool(const std::string &)> &on_line={})

References clamdscan_running(), bg_process::Result::exit_code, and bg_process::run().

Referenced by clamdscan_running().

◆ samba_temp_exists()

bool samba_temp_exists ( )
static

Definition at line 42 of file SambaPage.cpp.

43{
44 namespace fs = std::filesystem;
45
46 try {
47 fs::path base = fs::temp_directory_path() / "BastionGuard";
48 if (!fs::exists(base) || !fs::is_directory(base))
49 return false;
50
51 for (auto& p : fs::directory_iterator(base)) {
52 if (p.is_directory()) {
53 auto name = p.path().filename().string();
54 if (name.rfind("samba_scan_", 0) == 0)
55 return true;
56 }
57 }
58 } catch (...) {
59 return false;
60 }
61
62 return false;
63}

References samba_temp_exists().

Referenced by samba_temp_exists().