Install usbguard-tmpfles.conf

Resolves: RHEL-78183
This commit is contained in:
Cropi 2025-02-06 09:40:51 +01:00
parent 54a4c55b11
commit a3455444d2
2 changed files with 66 additions and 1 deletions

58
tmpfiles.patch Normal file
View File

@ -0,0 +1,58 @@
From 306cad81aee91d6adb61acdb9f1a9900fe2a13cd Mon Sep 17 00:00:00 2001
From: Cropi <alakatos@redhat.com>
Date: Thu, 6 Feb 2025 08:00:59 +0100
Subject: [PATCH] =?UTF-8?q?At=20boot=20time,=20systemd=E2=80=91tmpfiles=20?=
=?UTF-8?q?processes=20this=20file=20and=20creates=20/var/log/usbguard=20s?=
=?UTF-8?q?o=20that=20the=20usbguard=20service=20can=20start=20successfull?=
=?UTF-8?q?y.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Makefile.am | 13 +++++++++++--
usbguard-tmpfiles.conf | 1 +
2 files changed, 12 insertions(+), 2 deletions(-)
create mode 100644 usbguard-tmpfiles.conf
diff --git a/Makefile.am b/Makefile.am
index 7dc6849..2a8bfeb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -90,8 +90,8 @@ $(top_builddir)/%.roff: %.adoc
$(INSTALL) -m 644 $(top_builddir)/$(@:.roff=) $(top_builddir)/$@
endif
-install-data-hook: install-daemon-conf install-systemd-service install-data-dbus
-uninstall-hook: uninstall-daemon-conf uninstall-systemd-service uninstall-data-dbus
+install-data-hook: install-daemon-conf install-systemd-service install-data-dbus install-tmpfiles
+uninstall-hook: uninstall-daemon-conf uninstall-systemd-service uninstall-data-dbus uninstall-tmpfiles
CLEANFILES+=\
$(top_builddir)/usbguard-daemon.conf
@@ -106,6 +106,15 @@ usbguard_confdir= $(sysconfdir)/usbguard
distuninstallcheck_listfiles= find . -type f ! -name rules.conf -print
+EXTRA_DIST+=usbguard-tmpfiles.conf
+
+install-tmpfiles:
+ mkdir -p ${DESTDIR}$(prefix)/lib/tmpfiles.d/
+ $(INSTALL_DATA) -m 640 ${srcdir}/usbguard-tmpfiles.conf ${DESTDIR}$(prefix)/lib/tmpfiles.d/usbguard.conf
+
+uninstall-tmpfiles:
+ rm ${DESTDIR}$(prefix)/lib/tmpfiles.d/usbguard.conf
+
install-daemon-conf: $(top_builddir)/usbguard-daemon.conf
$(MKDIR_P) $(DESTDIR)/$(usbguard_confdir)
$(MKDIR_P) $(DESTDIR)/$(usbguard_confdir)/IPCAccessControl.d
diff --git a/usbguard-tmpfiles.conf b/usbguard-tmpfiles.conf
new file mode 100644
index 0000000..e90908f
--- /dev/null
+++ b/usbguard-tmpfiles.conf
@@ -0,0 +1 @@
+d /var/log/usbguard 0700 root root - -
--
2.48.1

View File

@ -6,7 +6,7 @@
Name: usbguard
Version: 1.1.3
Release: 5%{?dist}
Release: 6%{?dist}
Summary: A tool for implementing USB device usage policy
License: GPL-2.0-or-later
## Not installed
@ -46,6 +46,7 @@ BuildRequires: systemd
Patch1: usbguard-revert-catch.patch
Patch2: disable-console-logging.patch
Patch3: tmpfiles.patch
%description
The USBGuard software framework helps to protect your computer against rogue USB
@ -125,6 +126,7 @@ device presence changes and displays them as pop-up notifications.
%patch -P 1 -p1 -b .catch
%patch -P 2 -p1
%patch -P 3 -p1
# Remove bundled library sources before build
rm -rf src/ThirdParty/{Catch,PEGTL}
@ -226,6 +228,7 @@ find %{buildroot} \( -name '*.la' -o -name '*.a' \) -exec rm -f {} ';'
%{_datadir}/man/man5/usbguard-rules.conf.5.gz
%{_datadir}/man/man1/usbguard.1.gz
%{_datadir}/bash-completion/completions/usbguard
%attr(640,root,root) %{_tmpfilesdir}/usbguard.conf
%files devel
%{_includedir}/*
@ -288,6 +291,10 @@ fi
%changelog
* Thu Feb 06 2025 Attila Lakatos <alakatos@redhat.com> - 1.1.3-6
- Install usbguard-tmpfles.conf
Resolves: RHEL-78183
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.1.3-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018