From: Ossama Othman Date: Sat, 26 Jan 2013 00:55:11 +0000 (-0800) Subject: Work around insufficient access permissions for unprivileged users. X-Git-Tag: accepted/2.0alpha-wayland/20130424.214608~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa7f85f22c196ccdd68f8deae7ecf627612daa5b;p=profile%2Fivi%2Fweston.git Work around insufficient access permissions for unprivileged users. Change-Id: I35f6693316cbd5b68c4695607210b25aa087bca4 Signed-off-by: Ossama Othman --- diff --git a/packaging/rc.weston b/packaging/rc.weston index 38176c0..5b86cc5 100644 --- a/packaging/rc.weston +++ b/packaging/rc.weston @@ -84,6 +84,16 @@ do_start() # to handle requests from services started subsequently which depend # on this one. As a last resort, sleep for some time. + # ************************************************************ + # HACK TO WORK AROUND INSUFFICIENT ACCESS PERMISSIONS FOR + # UNPRIVILEGED USERS. + # + # Ideally we should launch weston with weston-launch with the + # appropriate --user flag. Unfortunately, weston-launch isn't + # available due to missing package dependencies. + # ************************************************************ + chmod 777 $XDG_RUNTIME_DIR/wayland-0 + # *********************************************************** # HACK TO WORK AROUND BROKEN INFINITE LOOPS IN BOOT ANIMATION # VIRTUAL KEYBOARD BOOT SCRIPTS. diff --git a/packaging/weston.sh b/packaging/weston.sh index e5bf416..7d94bfa 100644 --- a/packaging/weston.sh +++ b/packaging/weston.sh @@ -2,11 +2,17 @@ if [ -z "$USER" ]; then export USER=root fi -XDG_RUNTIME_DIR=/run/user/$USER +if [ -z "$XDG_RUNTIME_DIR"]; then + # User may not have sufficient privilege to make a directory in + # /run/user/$USER. Fall back on a subdirectory /tmp instead. + XDG_RUNTIME_DIR=/tmp/run-$USER +fi if [ ! -d "${XDG_RUNTIME_DIR}" ]; then mkdir -p $XDG_RUNTIME_DIR - chmod 700 $XDG_RUNTIME_DIR + # This really should be 700 but we currently have to run Weston as + # root. + chmod 777 $XDG_RUNTIME_DIR fi export XDG_RUNTIME_DIR