hal-rpmdb-checker: Add capability for /opt/etc/hal path 49/262749/1 accepted/tizen/unified/20210820.101814 submit/tizen/20210819.080213
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 19 Aug 2021 06:40:22 +0000 (15:40 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 19 Aug 2021 06:40:22 +0000 (15:40 +0900)
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 <cw00.choi@samsung.com>
CMakeLists.txt
packaging/hal-api-common.spec
packaging/hal-rpmdb-checker.conf [new file with mode: 0644]

index cc86597..260849c 100644 (file)
@@ -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)
index 55ad46f..c699c35 100644 (file)
@@ -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 (file)
index 0000000..ce40897
--- /dev/null
@@ -0,0 +1,2 @@
+z      /opt/etc/hal/*  0664    root    system_fw       -
+t      /opt/etc/hal/*  -       -       -       -       security.SMACK64="System"