Browse Source

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).
Marek Marczykowski-Górecki 8 năm trước cách đây
mục cha
commit
89d002a031
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      core-modules/000QubesVm.py

+ 1 - 1
core-modules/000QubesVm.py

@@ -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"]]