Work around insufficient access permissions for unprivileged users. 04/2704/1 accepted/2.0alpha-wayland/20130126.004737 submit/2.0alpha-wayland/20130126.011305
authorOssama Othman <ossama.othman@intel.com>
Sat, 26 Jan 2013 00:55:11 +0000 (16:55 -0800)
committerOssama Othman <ossama.othman@intel.com>
Sat, 26 Jan 2013 00:55:11 +0000 (16:55 -0800)
Change-Id: I35f6693316cbd5b68c4695607210b25aa087bca4
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
packaging/rc.weston
packaging/weston.sh

index 38176c0..5b86cc5 100644 (file)
@@ -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.
index e5bf416..7d94bfa 100644 (file)
@@ -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