X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=conf%2Fsystem%2Fafm-user-setup.sh.in;h=1b619a0ff12241bf0187b9682f3255f08c97a68b;hb=733369053bfa6b53479db613781bb68aa89b00e2;hp=24795ae6ea6b387487241c311cd2063bc76f098f;hpb=cc937529cdf8fad47b9b988fe205406f75d61acd;p=src%2Fapp-framework-main.git diff --git a/conf/system/afm-user-setup.sh.in b/conf/system/afm-user-setup.sh.in index 24795ae..1b619a0 100644 --- a/conf/system/afm-user-setup.sh.in +++ b/conf/system/afm-user-setup.sh.in @@ -1,26 +1,30 @@ -#!bin/sh +#!/bin/sh -uid=$1 -udir=/run/user/$uid +uid="$1" +bdir=/run/user +udir="$bdir/$uid" dodir() { - if ! test -e $1; then - mkdir -m 700 $1 - chown $uid:$uid $1 - chsmack -a '*' $1 - fi + local x smackset="$1" + shift + for x; do + test -e "$x" || mkdir -m 700 "$x" + chmod 700 "$x" + chown "$uid:$uid" "$x" + chsmack $smackset "$x" + done } -dodir $udir -dodir $udir/apis -dodir $udir/apis/ws -dodir $udir/apis/link +dodir '-T -a User::App-Shared' "$udir" +dodir '-t -a User::App-Shared' "$udir/usrshr" +dodir '-T -a System::Shared' "$udir/apis" +dodir '-t -a System::Shared' "$udir/apis/ws" "$udir/apis/link" doln() { - if ! test -e $2; then - ln -sf $1 $2 - chown -h $uid:$uid $2 - chsmack -a '*' $2 + if ! test -e "$2"; then + ln -sf "$1" "$2" + chown -h "$uid:$uid" "$2" + chsmack -a 'System::Shared' "$2" fi }