From 9527f0046777b4fbee5ec277c3e6e8b3034e71af Mon Sep 17 00:00:00 2001 From: Tanguy Raufflet Date: Wed, 23 Oct 2024 15:05:40 +0200 Subject: [PATCH] netdata: add setuid to the xenstat plugin file As mentioned in the Netdata documentation [1], The xenstat plugin requires elevated privileges to be executed. The xenstat.plugin permissions are modified to only allow users belonging to the netdata group to execute the plugin with root privileges. [1] https://learn.netdata.cloud/docs/collecting-metrics/containers-and-vms/xen-xcp-ng Signed-off-by: Tanguy Raufflet Signed-off-by: Khem Raj --- meta-webserver/recipes-webadmin/netdata/netdata_1.47.3.bb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.3.bb b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.3.bb index 3b9ae9ca89..bc73e40eff 100644 --- a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.3.bb +++ b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.3.bb @@ -87,6 +87,12 @@ do_install:append() { chmod 4750 ${D}${libexecdir}/netdata/plugins.d/apps.plugin rm -rf ${D}/${localstatedir}/ + if ${@bb.utils.contains('PACKAGECONFIG', 'xenstat', 'true', 'false', d)}; then + # Set S UID for xenstat plugin + chown root:netdata ${D}${libexecdir}/netdata/plugins.d/xenstat.plugin + chmod 4750 ${D}${libexecdir}/netdata/plugins.d/xenstat.plugin + fi + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then # Install systemd unit files install -Dm 0644 ${UNPACKDIR}/netdata-volatiles.conf ${D}${sysconfdir}/tmpfiles.d/netdata.conf