summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd/snmpe.c
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2022-08-23 08:56:22 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2022-08-23 08:56:22 +0000
commitd22bfb695a028538e4f01a769177d2a1586e62c5 (patch)
tree5d2770194179e5d22e07ecea1d57250a06a6112f /usr.sbin/snmpd/snmpe.c
parentb1f93ce47bb6913e0760cc10338efd1d18776f2c (diff)
(Re)add support for agentx in snmpd
Current omissions in protocol support are notifications, index (de)allocation, and agent capabilities. Help testing sthen@ Feedback/tweaks/OK jmatthew@
Diffstat (limited to 'usr.sbin/snmpd/snmpe.c')
-rw-r--r--usr.sbin/snmpd/snmpe.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/snmpd/snmpe.c b/usr.sbin/snmpd/snmpe.c
index 19c0f009941..3fa22de026f 100644
--- a/usr.sbin/snmpd/snmpe.c
+++ b/usr.sbin/snmpd/snmpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpe.c,v 1.82 2022/01/19 11:00:56 martijn Exp $ */
+/* $OpenBSD: snmpe.c,v 1.83 2022/08/23 08:56:21 martijn Exp $ */
/*
* Copyright (c) 2007, 2008, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -33,6 +33,7 @@
#include <errno.h>
#include <event.h>
#include <fcntl.h>
+#include <locale.h>
#include <string.h>
#include <unistd.h>
#include <pwd.h>
@@ -74,6 +75,9 @@ snmpe(struct privsep *ps, struct privsep_proc *p)
struct oid *oid;
#endif
+ if ((setlocale(LC_CTYPE, "en_US.UTF-8")) == NULL)
+ fatal("setlocale(LC_CTYPE, \"en_US.UTF-8\")");
+
#ifdef DEBUG
for (oid = NULL; (oid = smi_foreach(oid, 0)) != NULL;) {
smi_oid2string(&oid->o_id, buf, sizeof(buf), 0);
@@ -81,6 +85,8 @@ snmpe(struct privsep *ps, struct privsep_proc *p)
}
#endif
+ appl();
+
/* bind SNMP UDP/TCP sockets */
TAILQ_FOREACH(h, &env->sc_addresses, entry)
if ((h->fd = snmpe_bind(h)) == -1)