From b088d09dfda9b42c5c31b12a1b77101dffdf8c5a Mon Sep 17 00:00:00 2001 From: Jeremie Courreges-Anglas Date: Thu, 8 Dec 2016 10:55:04 +0100 Subject: [PATCH] Use kvm_openfiles with KVM_NO_FILES on OpenBSD (#2061) Starting with OpenBSD 6.1, access to kvm device is restricted by default, and processes plugin doesnt need specific privileges on it. Fixes 'permission denied' error messages with the kern.allowkmem sysctl defaulting to 0. --- src/processes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/processes.c b/src/processes.c index 86f690f3..4f61351a 100644 --- a/src/processes.c +++ b/src/processes.c @@ -1916,7 +1916,7 @@ static int ps_read(void) { ps_list_reset(); /* Open the kvm interface, get a descriptor */ - kd = kvm_open(NULL, NULL, NULL, 0, errbuf); + kd = kvm_openfiles(NULL, NULL, NULL, KVM_NO_FILES, errbuf); if (kd == NULL) { ERROR("processes plugin: Cannot open kvm interface: %s", errbuf); return (0); -- 2.11.0