qubes/ext/gui: adjust shm.id path

It's moved to /var/run/qubes and now is built based on $DISPLAY.
This commit is contained in:
Marek Marczykowski-Górecki 2017-01-18 03:26:32 +01:00
parent 1c20aae98a
commit a317e81d7e
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -135,8 +135,8 @@ class GUI(qubes.ext.Extension):
GUI daemon securely displays windows from domain.
''' # pylint: disable=no-self-use,unused-argument
if not start_guid or preparing_dvm \
or not os.path.exists('/var/run/shm.id'):
if not start_guid or preparing_dvm:
return
if self.is_guid_running(vm):
@ -150,6 +150,18 @@ class GUI(qubes.ext.Extension):
vm.log.error('Not starting gui daemon, no DISPLAY set')
return
display = os.getenv('DISPLAY')
if not display.startswith(':'):
vm.log.error('Expected local $DISPLAY, got \'{}\''.format(display))
return
display_num = display[1:].partition('.')[0]
shmid_path = '/var/run/qubes/shm.id.{}'.format(display_num)
if not os.path.exists(shmid_path):
vm.log.error(
'Not starting gui daemon, no {} file'.format(shmid_path))
return
vm.log.info('Starting gui daemon')
guid_cmd = [qubes.config.system_path['qubes_guid_path'],