Skip to content

Commit

Permalink
packaging: add cap_dac_read_search to go.d.plugin (netdata#16754)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Jan 11, 2024
1 parent f2b250a commit 1b3eb5b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contrib/debian/netdata-plugin-go.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ case "$1" in
configure|reconfigure)
chown root:netdata /usr/libexec/netdata/plugins.d/go.d.plugin
chmod 0750 /usr/libexec/netdata/plugins.d/go.d.plugin
if ! setcap "cap_net_admin=eip cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin; then
if ! setcap "cap_dac_read_search+epi cap_net_admin=eip cap_net_raw=eip" /usr/libexec/netdata/plugins.d/go.d.plugin; then
chmod -f 4750 /usr/libexec/netdata/plugins.d/go.d.plugin
fi
;;
Expand Down
2 changes: 1 addition & 1 deletion netdata-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,7 @@ install_go

if [ -f "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin" ]; then
if command -v setcap 1>/dev/null 2>&1; then
run setcap "cap_net_admin+epi cap_net_raw=eip" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin"
run setcap "cap_dac_read_search+epi cap_net_admin+epi cap_net_raw=eip" "${NETDATA_PREFIX}/usr/libexec/netdata/plugins.d/go.d.plugin"
fi
fi

Expand Down
2 changes: 1 addition & 1 deletion netdata.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ fi
%defattr(0750,root,netdata,0750)
# CAP_NET_ADMIN needed for WireGuard collector
# CAP_NET_RAW needed for ping collector
%caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/%{go_name}
%caps(cap_dac_read_search,cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/%{go_name}
%defattr(0644,root,netdata,0755)
%{_libdir}/%{name}/conf.d/go.d.conf
%{_libdir}/%{name}/conf.d/go.d
Expand Down
2 changes: 1 addition & 1 deletion packaging/makeself/install-or-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ if command -v setcap >/dev/null 2>&1; then
run setcap "cap_sys_admin=ep" "usr/libexec/netdata/plugins.d/perf.plugin"
fi

run setcap "cap_net_admin,cap_net_raw=eip" "usr/libexec/netdata/plugins.d/go.d.plugin"
run setcap "cap_dac_read_search+epi cap_net_admin+epi cap_net_raw=eip" "usr/libexec/netdata/plugins.d/go.d.plugin"
else
for x in ndsudo apps.plugin perf.plugin slabinfo.plugin debugfs.plugin; do
f="usr/libexec/netdata/plugins.d/${x}"
Expand Down

0 comments on commit 1b3eb5b

Please sign in to comment.