diff --git a/meson.build b/meson.build index b64dc2a..791aaf7 100644 --- a/meson.build +++ b/meson.build @@ -75,3 +75,4 @@ install_data(sources: 'zypper-plugin/permissions.py', install_dir: 'lib/zypp/plu install_data(sources: ['etc/variables.conf', 'etc/permissions', 'profiles/permissions.easy', 'profiles/permissions.secure', 'profiles/permissions.paranoid'], install_dir: 'share/permissions') install_data(sources: 'etc/permissions.local', install_dir: '/etc') install_subdir('permissions.d', install_dir: 'share/permissions') +install_data(sources: 'rpm_macros/macros.permissions', install_dir: 'lib/rpm/macros.d') diff --git a/rpm_macros/macros.permissions b/rpm_macros/macros.permissions new file mode 100644 index 0000000..9ae54e1 --- /dev/null +++ b/rpm_macros/macros.permissions @@ -0,0 +1,17 @@ + +%set_permissions(f:) \ + if [ -x /usr/bin/permctl ]; then \ + /usr/bin/permctl -n --set --system %{**} || : \ + elif [ -x /usr/bin/chkstat ]; then \ + /usr/bin/chkstat -n --set --system %{**} || : \ + fi \ + %nil + +%verify_permissions(e:f:) \ + if [ -x /usr/bin/permctl ]; then \ + /usr/bin/permctl -n --warn --system %{**} 1>&2 \ + else \ + /usr/bin/chkstat -n --warn --system %{**} 1>&2 \ + fi \ + %nil +