Преглед на файлове

Wait for user session as X session owner

... instead of requested user. This makes sure that session startup
script will be able to send a signal here to notify about session
startup.

This is especially needed when the first service started in the VM is
called as root (like qubes.InstallUpdatesGUI).

Fixes QubesOS/qubes-issues#3526
Marek Marczykowski-Górecki преди 6 години
родител
ревизия
96aa933024
променени са 1 файла, в които са добавени 7 реда и са изтрити 1 реда
  1. 7 1
      qubes-rpc/qubes.WaitForSession

+ 7 - 1
qubes-rpc/qubes.WaitForSession

@@ -1,5 +1,11 @@
 #!/bin/sh
-read -r USERNAME
+
+# old API - get the user from caller
+#read -r IGNORE_USERNAME
+
+# use default user provided in QubesDB, or hardcoded 'user' - this must be the
+# same as the X session owner
+USERNAME=$(qubesdb-read /default-user || echo 'user')
 cmd='echo $$ >> /tmp/qubes-session-waiter; [ ! -f /tmp/qubes-session-env ] && exec sleep inf'
 if [ "$(id -un)" = "$USERNAME" ]; then
     sh -c "$cmd" 2>/dev/null