Introduction
Introduction Statistics Contact Development Disclaimer Help
duckduckgo: fix an abort "rpath" on OpenBSD - frontends - front-ends for some s…
Log
Files
Refs
README
LICENSE
---
commit e0eb56d566e98aa2c886de31b9df6c7e6636b00a
parent bb2aaedc735f352dc4f90f427f22b94bd906d917
Author: Hiltjo Posthuma <[email protected]>
Date: Thu, 3 Sep 2020 17:05:02 +0200
duckduckgo: fix an abort "rpath" on OpenBSD
Diffstat:
M duckduckgo/cli.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/duckduckgo/cli.c b/duckduckgo/cli.c
@@ -2,6 +2,7 @@
#include <ctype.h>
#include <err.h>
+#include <errno.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
@@ -10,6 +11,7 @@
#include <wchar.h>
#include "duckduckgo.h"
+#include "https.h"
#include "util.h"
#define OUT(s) fputs((s), stdout)
@@ -34,15 +36,29 @@ main(int argc, char *argv[])
setlocale(LC_CTYPE, "");
- if (pledge("stdio", NULL) == -1)
- err(1, "pledge");
+ if (pledge("stdio dns inet rpath unveil", NULL) == -1) {
+ fprintf(stderr, "pledge: %s\n", strerror(errno));
+ exit(1);
+ }
+ if (unveil(TLS_CA_CERT_FILE, "r") == -1) {
+ fprintf(stderr, "unveil: %s\n", strerror(errno));
+ exit(1);
+ }
+ if (unveil(NULL, NULL) == -1) {
+ fprintf(stderr, "unveil: %s\n", strerror(errno));
+ exit(1);
+ }
if (argc != 2) {
fprintf(stderr, "usage: %s <search>\n", argv[0]);
exit(1);
}
- if ((results = duckduckgo_search(argv[1]))) {
+ results = duckduckgo_search(argv[1]);
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
+ if (results) {
for (i = 0; i < results->nitems; i++) {
result = &(results->items[i]);
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.