From: jooseong lee Date: Wed, 28 Dec 2016 07:55:59 +0000 (+0900) Subject: Set smack label to /etc/skel/share/.voice and {user home}/share/.voice X-Git-Tag: submit/tizen_3.0/20161228.082439^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16df07f1fc9db801b3667c311b13e98ab47c2f2c;p=platform%2Fcore%2Fsecurity%2Fsecurity-config.git Set smack label to /etc/skel/share/.voice and {user home}/share/.voice Change-Id: I1ea6b92c00f261daf43abc971bc05b8cb4bbd9bc Signed-off-by: jooseong lee --- diff --git a/config/set_capability b/config/set_capability index ec0b41c..1cfeceb 100755 --- a/config/set_capability +++ b/config/set_capability @@ -355,3 +355,22 @@ if [ -e "/usr/bin/email-service" ] then /usr/sbin/setcap cap_chown=eip /usr/bin/email-service 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` +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 +done