core: use runuser instead of sudo for switching root->user

There are problems with using sudo in early system startup
(systemd-logind not running yet, pam_systemd timeouts). Since we don't
need full session here, runuser is good enough (even better: faster).
This commit is contained in:
Marek Marczykowski-Górecki 2016-06-06 02:19:51 +02:00
parent 2265fd3d52
commit 89d002a031
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1830,7 +1830,7 @@ class QubesVm(object):
# many qrexec services would need to deal with root/user
# permission problems
qubes_group = grp.getgrnam('qubes')
qrexec = ['sudo', '-u', qubes_group.gr_mem[0]]
qrexec = ['runuser', '-u', qubes_group.gr_mem[0], '--']
qrexec += ['env', 'QREXEC_STARTUP_TIMEOUT=' + str(self.qrexec_timeout),
system_path["qrexec_daemon_path"]]