summaryrefslogtreecommitdiffstats
path: root/plugins/check_ntp_time.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_ntp_time.c')
-rw-r--r--plugins/check_ntp_time.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index 9e0beb9c..5955d22e 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -640,11 +640,7 @@ static check_ntp_time_config_wrapper process_arguments(int argc, char **argv) {
640 address_family = AF_INET; 640 address_family = AF_INET;
641 break; 641 break;
642 case '6': 642 case '6':
643#ifdef USE_IPV6
644 address_family = AF_INET6; 643 address_family = AF_INET6;
645#else
646 usage4(_("IPv6 support not available"));
647#endif
648 break; 644 break;
649 case '?': 645 case '?':
650 /* print short usage statement if args not parsable */ 646 /* print short usage statement if args not parsable */
@@ -661,6 +657,14 @@ static check_ntp_time_config_wrapper process_arguments(int argc, char **argv) {
661} 657}
662 658
663int main(int argc, char *argv[]) { 659int main(int argc, char *argv[]) {
660#ifdef __OpenBSD__
661 /* - rpath is required to read --extra-opts (given up later)
662 * - inet is required for sockets
663 * - unix is required for Unix domain sockets
664 * - dns is required for name lookups */
665 pledge("stdio rpath inet unix dns", NULL);
666#endif // __OpenBSD__
667
664 setlocale(LC_ALL, ""); 668 setlocale(LC_ALL, "");
665 bindtextdomain(PACKAGE, LOCALEDIR); 669 bindtextdomain(PACKAGE, LOCALEDIR);
666 textdomain(PACKAGE); 670 textdomain(PACKAGE);
@@ -674,6 +678,10 @@ int main(int argc, char *argv[]) {
674 usage4(_("Could not parse arguments")); 678 usage4(_("Could not parse arguments"));
675 } 679 }
676 680
681#ifdef __OpenBSD__
682 pledge("stdio inet unix dns", NULL);
683#endif // __OpenBSD__
684
677 const check_ntp_time_config config = tmp_config.config; 685 const check_ntp_time_config config = tmp_config.config;
678 686
679 if (config.output_format_is_set) { 687 if (config.output_format_is_set) {