From 78cc3efa9d322471a9fb7389ec5350d4d12a61ac Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 19 Aug 2021 15:40:22 +0900 Subject: [PATCH] hal-rpmdb-checker: Add capability for /opt/etc/hal path hal-rpmdb-checker.service has used /opt/etc/hal path in order to create the files for both checking the platform booting is first booting and hal rpmdb version are matched or not. So that /opt/etc/hal patch should be set with the proper capability with UID/GID/Smack lable. Change-Id: I07bec1b2f824d8a0114659346bab09911f863e42 Signed-off-by: Chanwoo Choi --- CMakeLists.txt | 2 ++ packaging/hal-api-common.spec | 2 ++ packaging/hal-rpmdb-checker.conf | 2 ++ 3 files changed, 6 insertions(+) create mode 100644 packaging/hal-rpmdb-checker.conf diff --git a/CMakeLists.txt b/CMakeLists.txt index cc86597..260849c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,5 +51,7 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ FILES_MATCHING PATTERN "*.h") INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/${PROJECT_NAME}.pc DESTINATION ${LIBDIR}/pkgconfig) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/hal-rpmdb-checker.conf + DESTINATION /usr/lib/tmpfiles.d) ADD_SUBDIRECTORY(tests) diff --git a/packaging/hal-api-common.spec b/packaging/hal-api-common.spec index 55ad46f..c699c35 100644 --- a/packaging/hal-api-common.spec +++ b/packaging/hal-api-common.spec @@ -88,6 +88,7 @@ rm -rf %{buildroot} %post /sbin/ldconfig chsmack -a "System" -t %{hal_rpmdb_checker_path} +systemd-tmpfiles /usr/lib/tmpfiles.d/hal-rpmdb-checker.conf --create %postun /sbin/ldconfig @@ -118,3 +119,4 @@ chsmack -a "System" -t %{hal_rpmdb_checker_path} %{_unitdir}/sysinit.target.wants/hal-rpmdb-checker.service %{_unitdir}/hal-rpmdb-checker.service %{_bindir}/hal-rpmdb-checker +/usr/lib/tmpfiles.d/hal-rpmdb-checker.conf diff --git a/packaging/hal-rpmdb-checker.conf b/packaging/hal-rpmdb-checker.conf new file mode 100644 index 0000000..ce40897 --- /dev/null +++ b/packaging/hal-rpmdb-checker.conf @@ -0,0 +1,2 @@ +z /opt/etc/hal/* 0664 root system_fw - +t /opt/etc/hal/* - - - - security.SMACK64="System" -- 2.7.4