[ML Agent] Enable PIE option for Tizen security check
authorSangjung Woo <sangjung.woo@samsung.com>
Sat, 20 Aug 2022 05:26:57 +0000 (14:26 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Sun, 21 Aug 2022 09:24:39 +0000 (18:24 +0900)
This patch enables the PIE (Position Independent Executable) option to
comply with Tizen security. If this option is not enabled, the daemon
file will be lost its executable permission when making platform image.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
daemon/meson.build
packaging/machine-learning-api.spec

index baa7a0d..63c3f1f 100644 (file)
@@ -64,8 +64,8 @@ if get_option('enable-machine-learning-agent')
     include_directories: nns_ml_agent_incs,
     install: true,
     install_dir: api_install_bindir,
-    cpp_args : '-DDB_PATH="' + serviceDBPath + '"'
-
+    cpp_args : '-DDB_PATH="' + serviceDBPath + '"',
+    pie : true
   )
 
   # For unit test
index 01edb71..e8f3c73 100644 (file)
@@ -464,9 +464,9 @@ cp -r result %{buildroot}%{_datadir}/ml-api/unittest/
 %if 0%{?enable_machine_learning_agent}
 %files -n machine-learning-agent
 %manifest machine-learning-agent.manifest
-%{_bindir}/machine-learning-agent
-%{_unitdir}/machine-learning-agent.service
-%config %{_sysconfdir}/dbus-1/system.d/machine-learning-agent.conf
+%attr(0755,root,root) %{_bindir}/machine-learning-agent
+%attr(0644,root,root) %{_unitdir}/machine-learning-agent.service
+%attr(0644,root,root) %config %{_sysconfdir}/dbus-1/system.d/machine-learning-agent.conf
 %attr(0644,root,root) %{_datadir}/dbus-1/system-services/org.tizen.machinelearning.service.service
 %endif