app: call admin.vm.volume.Import as root
This is needed to write LVM data.
This commit is contained in:
parent
f0151d73b3
commit
ca399c1a5a
@ -445,11 +445,12 @@ class QubesLocal(QubesBase):
|
|||||||
if not os.path.exists(method_path):
|
if not os.path.exists(method_path):
|
||||||
raise qubesadmin.exc.QubesDaemonCommunicationError(
|
raise qubesadmin.exc.QubesDaemonCommunicationError(
|
||||||
'{} not found'.format(method_path))
|
'{} not found'.format(method_path))
|
||||||
qrexec_call_env = os.environ.copy()
|
command = ['env', 'QREXEC_REMOTE_DOMAIN=dom0',
|
||||||
qrexec_call_env['QREXEC_REMOTE_DOMAIN'] = 'dom0'
|
'QREXEC_REQUESTED_TARGET=' + dest, method_path, arg]
|
||||||
qrexec_call_env['QREXEC_REQUESTED_TARGET'] = dest
|
if os.getuid() != 0:
|
||||||
proc = subprocess.Popen([method_path, arg], stdin=payload_stream,
|
command.insert(0, 'sudo')
|
||||||
stdout=subprocess.PIPE, env=qrexec_call_env)
|
proc = subprocess.Popen(command, stdin=payload_stream,
|
||||||
|
stdout=subprocess.PIPE)
|
||||||
payload_stream.close()
|
payload_stream.close()
|
||||||
(return_data, _) = proc.communicate()
|
(return_data, _) = proc.communicate()
|
||||||
return self._parse_qubesd_response(return_data)
|
return self._parse_qubesd_response(return_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user