#!/bin/sh
uid=$1
udir=/run/user/$uid
dodir_star() {
if ! test -e $1; then
mkdir -m 700 $1
chown $uid:$uid $1
fi
chsmack -a '*' $1
}
dodir_star $udir
dodir_star $udir/apis
dodir_star $udir/apis/ws
dodir_star $udir/apis/link
dodir_usrshr() {
if ! test -e $1; then
mkdir -m 700 $1
chown $uid:$uid $1
fi
chsmack -a User::App-Shared -t $1
}
dodir_usrshr $udir/usrshr
doln() {
if ! test -e $2; then
ln -sf $1 $2
chown -h $uid:$uid $2
chsmack -a '*' $2
fi
}
doln @afm_platform_rundir@/display/wayland-0 $udir/wayland-0