summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index e8c35f58..701af7b0 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -100,6 +100,14 @@ static int my_close(int /*socket_descriptor*/);
100static int verbose = 0; 100static int verbose = 0;
101 101
102int main(int argc, char **argv) { 102int main(int argc, char **argv) {
103#ifdef __OpenBSD__
104 /* - rpath is required to read --extra-opts (given up later)
105 * - inet is required for sockets
106 * - unix is required for Unix domain sockets
107 * - dns is required for name lookups */
108 pledge("stdio rpath inet unix dns", NULL);
109#endif // __OpenBSD__
110
103 setlocale(LC_ALL, ""); 111 setlocale(LC_ALL, "");
104 bindtextdomain(PACKAGE, LOCALEDIR); 112 bindtextdomain(PACKAGE, LOCALEDIR);
105 textdomain(PACKAGE); 113 textdomain(PACKAGE);
@@ -113,6 +121,10 @@ int main(int argc, char **argv) {
113 usage4(_("Could not parse arguments")); 121 usage4(_("Could not parse arguments"));
114 } 122 }
115 123
124#ifdef __OpenBSD__
125 pledge("stdio inet unix dns", NULL);
126#endif // __OpenBSD__
127
116 const check_smtp_config config = tmp_config.config; 128 const check_smtp_config config = tmp_config.config;
117 129
118 if (config.output_format_is_set) { 130 if (config.output_format_is_set) {
@@ -807,11 +819,7 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) {
807 address_family = AF_INET; 819 address_family = AF_INET;
808 break; 820 break;
809 case '6': 821 case '6':
810#ifdef USE_IPV6
811 address_family = AF_INET6; 822 address_family = AF_INET6;
812#else
813 usage4(_("IPv6 support not available"));
814#endif
815 break; 823 break;
816 case 'V': /* version */ 824 case 'V': /* version */
817 print_revision(progname, NP_VERSION); 825 print_revision(progname, NP_VERSION);