Skip to content

Commit

Permalink
Relax check on repository qrexec call
Browse files Browse the repository at this point in the history
Consider only non-zero exit code as a failure. Otherwise consider stderr
as just a warning.

QubesOS/qubes-issues#7306
  • Loading branch information
marmarek committed Feb 26, 2022
1 parent a02e307 commit bd6d55e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions qubesmanager/global_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#

import os
import sys
import subprocess
import pkg_resources
from PyQt5 import QtWidgets, QtCore, QtGui # pylint: disable=import-error
Expand Down Expand Up @@ -52,16 +53,17 @@ def _run_qrexec_repo(service, arg=''):
check=False,
env=env
)
if p.stderr:
msg = QtCore.QCoreApplication.translate(
"GlobalSettings",
'qrexec call stderr was not empty')
raise exc.QubesException(msg + ' (%s)', p.stderr.decode('utf-8'))
if p.returncode != 0:
msg = QtCore.QCoreApplication.translate(
"GlobalSettings",
'qrexec call exited with non-zero return code')
raise exc.QubesException(msg + ' (%s)', p.returncode)
raise exc.QubesException(msg + ' (%s): %s',
p.returncode, p.stderr.decode('utf-8'))
if p.stderr:
msg = QtCore.QCoreApplication.translate(
"GlobalSettings",
'%s qrexec call stderr was not empty (%s)')
print(msg % (service, p.stderr.decode('utf-8')), file=sys.stderr)
return p.stdout.decode('utf-8')


Expand Down

0 comments on commit bd6d55e

Please sign in to comment.