From 04b9cdcd990f34fa3e6354e8647f2ec2b255b073 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 18 Aug 2026 06:56:58 -0400 Subject: [PATCH] Revert "openbsd: fix a issue from IRC chat" This reverts commit 55ecab7c8df3b92dd127903ae5755fe781e63203. --- daemon/Daemon.cpp | 20 ++------------------ libi2pd/Config.cpp | 1 - 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/daemon/Daemon.cpp b/daemon/Daemon.cpp index 35bf259a..d6f637b9 100644 --- a/daemon/Daemon.cpp +++ b/daemon/Daemon.cpp @@ -12,10 +12,10 @@ #ifdef __OpenBSD__ # include -# include #endif #include "Daemon.h" + #include "Config.h" #include "Log.h" #include "FS.h" @@ -140,31 +140,15 @@ namespace util }; auto unveil_path = [](std::string path, std::string rules = "r") { - // https://stackoverflow.com/questions/83439/remove-spaces-from-stdstring-in-c - path.erase(remove_if(path.begin(), path.end(), isspace), path.end()); if(path=="") { LogPrint(eLogDebug, "empty path for unveil"); return; } - if ( (!std::filesystem::exists(path) && !std::filesystem::is_directory(path)) ) - { - { - std::ofstream f{path}; - if(!f) - { - LogPrint(eLogError, "can't create an empty file " + path); - throw std::runtime_error("Can't create a file and it's not directory"); - } - } - } if ( unveil(path.c_str(), rules.c_str()) == -1 ) { LogPrint(eLogError, "Can't unveil " + path + " with rules " + rules); - bool ignore_unveil; - i2p::config::GetOption("openbsd.unveil_ignore", ignore_unveil); - if(!ignore_unveil) - throw std::runtime_error("can't unveil"); + throw std::runtime_error("can't unveil"); } LogPrint(eLogInfo, "unveil " + path + " with rules " + rules); }; diff --git a/libi2pd/Config.cpp b/libi2pd/Config.cpp index 89cea2c7..e7e58321 100644 --- a/libi2pd/Config.cpp +++ b/libi2pd/Config.cpp @@ -410,7 +410,6 @@ namespace config { ("openbsd.unveil_file", value()->default_value(""), "OpenBSD file with unveil rules") ("openbsd.unveil_enabled", value()->default_value(true), "use unveil rues") ("openbsd.pledge_enabled", value()->default_value(true), "use pledge rules") - ("openbsd.unveil_ignore", value()->default_value(false), "ignore unveil errors") ; #endif