SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
31
devel/woboq_codebrowser/patches/patch-generator_main_cpp
Normal file
31
devel/woboq_codebrowser/patches/patch-generator_main_cpp
Normal file
|
@ -0,0 +1,31 @@
|
|||
add pledge(2) and unveil(2) to codebrowser_generator
|
||||
|
||||
Index: generator/main.cpp
|
||||
--- generator/main.cpp.orig
|
||||
+++ generator/main.cpp
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "compat.h"
|
||||
#include <ctime>
|
||||
|
||||
+#include <unistd.h>
|
||||
+
|
||||
#include "embedded_includes.h"
|
||||
|
||||
namespace cl = llvm::cl;
|
||||
@@ -325,6 +327,16 @@ int main(int argc, const char **argv) {
|
||||
}
|
||||
|
||||
llvm::cl::ParseCommandLineOptions(argc, argv);
|
||||
+
|
||||
+ create_directories(OutputPath);
|
||||
+ if ((unveil(OutputPath.c_str(), "rwc") == -1) || (unveil("/", "r") == -1)) {
|
||||
+ std::cerr << "error: unveil" << std::endl;
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+ if (pledge("stdio rpath wpath cpath tty", "") == -1) {
|
||||
+ std::cerr << "error: pledge" << std::endl;
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
|
||||
#ifdef _WIN32
|
||||
make_forward_slashes(OutputPath._Get_data()._Myptr());
|
|
@ -0,0 +1,29 @@
|
|||
add pledge(2) and unveil(2) to codebrowser_indexgenerator.
|
||||
|
||||
Index: indexgenerator/indexer.cpp
|
||||
--- indexgenerator/indexer.cpp.orig
|
||||
+++ indexgenerator/indexer.cpp
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <map>
|
||||
#include <ctime>
|
||||
|
||||
+#include <unistd.h>
|
||||
+
|
||||
#include "../global.h"
|
||||
|
||||
const char *data_url = "../data";
|
||||
@@ -228,6 +230,14 @@ int main(int argc, char **argv) {
|
||||
if (root.empty()) {
|
||||
std::cerr << "Usage: " << argv[0] << " <path> [-d data_url] [-p project_definition]" << std::endl;
|
||||
return -1;
|
||||
+ }
|
||||
+ if ((unveil(root.c_str(), "rwc") == -1) || (unveil("/", "r") == -1)) {
|
||||
+ std::cerr << "error: unveil" << std::endl;
|
||||
+ return EXIT_FAILURE;
|
||||
+ }
|
||||
+ if (pledge("stdio rpath wpath cpath tty", "") == -1) {
|
||||
+ std::cerr << "error: pledge" << std::endl;
|
||||
+ return EXIT_FAILURE;
|
||||
}
|
||||
std::ifstream fileIndex(root + "/" + "fileIndex");
|
||||
std::string line;
|
Loading…
Add table
Add a link
Reference in a new issue