Remove SMACK label for 3 domain rule policy. 58/43558/1
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 10 Jul 2015 05:59:23 +0000 (14:59 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Fri, 10 Jul 2015 05:59:23 +0000 (14:59 +0900)
Change-Id: I084ba9bdd8d74f36c6b2986f9e56a8d9c9746731

CMakeLists.txt
packaging/data-provider-master.spec
src/util.c

index fd4acd9..d7ca326 100644 (file)
@@ -76,12 +76,12 @@ ADD_DEFINITIONS("-DSHORTCUT_SOCKET=\"/tmp/.shortcut.service\"")
 ADD_DEFINITIONS("-DNOTIFICATION_SOCKET=\"/tmp/.notification.service\"")
 ADD_DEFINITIONS("-DUTILITY_SOCKET=\"/tmp/.utility.service\"")
 
-ADD_DEFINITIONS("-DUTILITY_SMACK_LABEL=\"${PROJECT_NAME}::utility\"")
-ADD_DEFINITIONS("-DSHORTCUT_SMACK_LABEL=\"${PROJECT_NAME}::shortcut\"")
-ADD_DEFINITIONS("-DNOTIFICATION_SMACK_LABEL=\"${PROJECT_NAME}::notification\"")
-ADD_DEFINITIONS("-DBADGE_SMACK_LABEL=\"${PROJECT_NAME}::badge\"")
-ADD_DEFINITIONS("-DDATA_SHARE_LABEL=\"${PROJECT_NAME}::share\"")
-ADD_DEFINITIONS("-DDEFAULT_SMACK_LABEL=\"${PROJECT_NAME}\"")
+ADD_DEFINITIONS("-DUTILITY_SMACK_LABEL=NULL")
+ADD_DEFINITIONS("-DSHORTCUT_SMACK_LABEL=NULL")
+ADD_DEFINITIONS("-DNOTIFICATION_SMACK_LABEL=NULL")
+ADD_DEFINITIONS("-DBADGE_SMACK_LABEL=NULL")
+ADD_DEFINITIONS("-DDATA_SHARE_LABEL=NULL")
+ADD_DEFINITIONS("-DDEFAULT_SMACK_LABEL=NULL")
 
 ADD_DEFINITIONS("-DDEFAULT_MASTER_CONF=\"/usr/share/${PROJECT_NAME}/conf.ini\"")
 
index 7ad8011..5d011b9 100644 (file)
@@ -187,7 +187,7 @@ echo "Successfully installed. Please start a daemon again manually"
 
 %files -n %{name}
 %manifest %{name}.manifest
-%defattr(-,system,system,-)
+%defattr(-,root,root,-)
 %caps(cap_chown,cap_dac_override,cap_dac_read_search,cap_sys_admin,cap_sys_nice,cap_mac_override,cap_mac_admin+ep) %{_bindir}/%{name}
 %{_prefix}/lib/systemd/user/default.target.wants/%{name}.service
 %{_prefix}/lib/systemd/user/default.target.wants/%{name}.path
@@ -200,8 +200,8 @@ echo "Successfully installed. Please start a daemon again manually"
 %{_prefix}/etc/package-manager/parserlib/*
 %{_datarootdir}/%{name}/*
 /opt/etc/dump.d/module.d/dump_widget.sh
+%defattr(-,owner,users,-)
 /opt/usr/share/live_magazine/*
 /opt/dbspace/.widget.db*
-#%{_sysconfdir}/smack/accesses.d/%{name}
 
 # End of a file
index 0144142..af1d6b8 100644 (file)
@@ -455,12 +455,14 @@ HAPI void util_prepare_emergency_disk(void)
                ErrPrint("chown: %d\n", errno);
        }
 
-       ret = smack_setlabel(WIDGET_CONF_IMAGE_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
-       if (ret != 0) {
-               ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_IMAGE_PATH, ret);
-       } else {
-               ret = smack_setlabel(WIDGET_CONF_IMAGE_PATH, "1", SMACK_LABEL_TRANSMUTE);
-               DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_IMAGE_PATH, ret);
+       if (!!DATA_SHARE_LABEL) {
+               ret = smack_setlabel(WIDGET_CONF_IMAGE_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
+               if (ret != 0) {
+                       ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_IMAGE_PATH, ret);
+               } else {
+                       ret = smack_setlabel(WIDGET_CONF_IMAGE_PATH, "1", SMACK_LABEL_TRANSMUTE);
+                       DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_IMAGE_PATH, ret);
+               }
        }
 
        if (mkdir(WIDGET_CONF_ALWAYS_PATH, 0755) < 0) {
@@ -474,12 +476,14 @@ HAPI void util_prepare_emergency_disk(void)
                        ErrPrint("chown: %d\n", errno);
                }
 
-               ret = smack_setlabel(WIDGET_CONF_ALWAYS_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
-               if (ret != 0) {
-                       ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_ALWAYS_PATH, ret);
-               } else {
-                       ret = smack_setlabel(WIDGET_CONF_ALWAYS_PATH, "1", SMACK_LABEL_TRANSMUTE);
-                       DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_ALWAYS_PATH, ret);
+               if (!!DATA_SHARE_LABEL) {
+                       ret = smack_setlabel(WIDGET_CONF_ALWAYS_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
+                       if (ret != 0) {
+                               ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_ALWAYS_PATH, ret);
+                       } else {
+                               ret = smack_setlabel(WIDGET_CONF_ALWAYS_PATH, "1", SMACK_LABEL_TRANSMUTE);
+                               DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_ALWAYS_PATH, ret);
+                       }
                }
        }
 
@@ -494,12 +498,14 @@ HAPI void util_prepare_emergency_disk(void)
                        ErrPrint("chown: %d\n", errno);
                }
 
-               ret = smack_setlabel(WIDGET_CONF_READER_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
-               if (ret != 0) {
-                       ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_READER_PATH, ret);
-               } else {
-                       ret = smack_setlabel(WIDGET_CONF_READER_PATH, "1", SMACK_LABEL_TRANSMUTE);
-                       DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_READER_PATH, ret);
+               if (!!DATA_SHARE_LABEL) {
+                       ret = smack_setlabel(WIDGET_CONF_READER_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
+                       if (ret != 0) {
+                               ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_READER_PATH, ret);
+                       } else {
+                               ret = smack_setlabel(WIDGET_CONF_READER_PATH, "1", SMACK_LABEL_TRANSMUTE);
+                               DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_READER_PATH, ret);
+                       }
                }
        }
 
@@ -532,12 +538,14 @@ HAPI void util_setup_log_disk(void)
                        ErrPrint("chown: %d\n", errno);
                }
 
-               ret = smack_setlabel(WIDGET_CONF_LOG_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
-               if (ret != 0) {
-                       ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_LOG_PATH, ret);
-               } else {
-                       ret = smack_setlabel(WIDGET_CONF_LOG_PATH, "1", SMACK_LABEL_TRANSMUTE);
-                       DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_LOG_PATH, ret);
+               if (!!DATA_SHARE_LABEL) {
+                       ret = smack_setlabel(WIDGET_CONF_LOG_PATH, DATA_SHARE_LABEL, SMACK_LABEL_ACCESS);
+                       if (ret != 0) {
+                               ErrPrint("Failed to set SMACK for %s (%d)\n", WIDGET_CONF_LOG_PATH, ret);
+                       } else {
+                               ret = smack_setlabel(WIDGET_CONF_LOG_PATH, "1", SMACK_LABEL_TRANSMUTE);
+                               DbgPrint("[%s] is successfully created (t: %d)\n", WIDGET_CONF_LOG_PATH, ret);
+                       }
                }
        }
 }