Set SMACK label to .multiassistant directory 19/208219/1 accepted/tizen/unified/20190621.050553 submit/tizen/20190620.044730
authorjin-gyu.kim <jin-gyu.kim@samsung.com>
Thu, 20 Jun 2019 04:36:16 +0000 (13:36 +0900)
committerjin-gyu.kim <jin-gyu.kim@samsung.com>
Thu, 20 Jun 2019 04:36:19 +0000 (13:36 +0900)
- Setting SMACK label is required  when image is being created.
- Target dir is /etc/skel/share/.multiassistant &
  /opt/usr/home/[username]/share/.multiassistant

Change-Id: I889b0d4ede17337b984cd809b2ba75ddf7994d9b

config/set_capability

index ea48db5975b01983b4200ed8e87888316f55058f..3590a4bf7039364c1fa6cc2576b0a4c200b89c2b 100755 (executable)
@@ -678,22 +678,26 @@ then /usr/sbin/setcap cap_net_raw,cap_sys_rawio=ei /usr/bin/ua-manager
 fi
 
 # TODO: MOVE TO OTHER SCRIPT OR REMOVE
-# Requested by sooyeon.kim@samsung.com
-if [ -e "/etc/skel/share/.voice" ]
-then
-find /etc/skel/share/.voice -print0 | xargs -0 chown app_fw:app_fw
-find /etc/skel/share/.voice -print0 | xargs -0 chsmack -a 'User::App::Shared'
-find /etc/skel/share/.voice -type d -print0 | xargs -0 chsmack -t
-fi
-
-for line in `find /opt/usr/home -maxdepth 1 -type d`
+# Requested by sooyeon.kim@samsung.com (.voice) and dalton.lee@samsung.com (.multiassistant)
+dir_list=(".voice" ".multiassistant")
+for item in "${dir_list[@]}"
 do
-        if [ -e "$line/share/.voice" ]; then
-                user=$(echo $line | cut -d"/" -f5);
-                find "$line/share/.voice" -print0 | xargs -0 chown $user:users
-                find "$line/share/.voice" -print0 | xargs -0 chsmack -a 'User::App::Shared'
-                find "$line/share/.voice" -type d -print0 | xargs -0 chsmack -t
-        fi
+       if [ -e "/etc/skel/share/$item" ]
+       then
+               find /etc/skel/share/$item -print0 | xargs -0 chown app_fw:app_fw
+               find /etc/skel/share/$item -print0 | xargs -0 chsmack -a 'User::App::Shared'
+               find /etc/skel/share/$item -type d -print0 | xargs -0 chsmack -t
+       fi
+
+       for line in `find /opt/usr/home -maxdepth 1 -type d`
+       do
+               if [ -e "$line/share/$item" ]; then
+                       user=$(echo $line | cut -d"/" -f5);
+                       find "$line/share/$item" -print0 | xargs -0 chown $user:users
+                       find "$line/share/$item" -print0 | xargs -0 chsmack -a 'User::App::Shared'
+                       find "$line/share/$item" -type d -print0 | xargs -0 chsmack -t
+               fi
+       done
 done
 
 # change permission to /opt/var/lib/misc