summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r--plugins/check_tcp.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 09806373..49a8c4c1 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -89,6 +89,14 @@ const int DEFAULT_NNTPS_PORT = 563;
89const int DEFAULT_CLAMD_PORT = 3310; 89const int DEFAULT_CLAMD_PORT = 3310;
90 90
91int main(int argc, char **argv) { 91int main(int argc, char **argv) {
92#ifdef __OpenBSD__
93 /* - rpath is required to read --extra-opts (given up later)
94 * - inet is required for sockets
95 * - unix is required for Unix domain sockets
96 * - dns is required for name lookups */
97 pledge("stdio rpath inet unix dns", NULL);
98#endif // __OpenBSD__
99
92 setlocale(LC_ALL, ""); 100 setlocale(LC_ALL, "");
93 bindtextdomain(PACKAGE, LOCALEDIR); 101 bindtextdomain(PACKAGE, LOCALEDIR);
94 textdomain(PACKAGE); 102 textdomain(PACKAGE);
@@ -216,6 +224,10 @@ int main(int argc, char **argv) {
216 usage4(_("Could not parse arguments")); 224 usage4(_("Could not parse arguments"));
217 } 225 }
218 226
227#ifdef __OpenBSD__
228 pledge("stdio inet unix dns", NULL);
229#endif // __OpenBSD__
230
219 config = paw.config; 231 config = paw.config;
220 232
221 if (verbosity > 0) { 233 if (verbosity > 0) {
@@ -571,11 +583,7 @@ static check_tcp_config_wrapper process_arguments(int argc, char **argv, check_t
571 address_family = AF_INET; 583 address_family = AF_INET;
572 break; 584 break;
573 case '6': // Apparently unused TODO 585 case '6': // Apparently unused TODO
574#ifdef USE_IPV6
575 address_family = AF_INET6; 586 address_family = AF_INET6;
576#else
577 usage4(_("IPv6 support not available"));
578#endif
579 break; 587 break;
580 case 'H': /* hostname */ 588 case 'H': /* hostname */
581 config.host_specified = true; 589 config.host_specified = true;