Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion qubes-rpc/qubes.StartApp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/python3 --

import sys, os, pwd
import hashlib
import base64
import qubesdb
from qubesagent.xdg import launch
from xdg.BaseDirectory import xdg_data_dirs
Expand All @@ -12,7 +14,22 @@ def main(argv):
print('This service requires an argument', file=sys.stderr)
sys.exit(1)
qubes_db = qubesdb.QubesDB()
if qubes_db.read('/qubes-service/app-dispvm.' + arg) is not None:
# replace default file handlers to open files in disposables
force_open_dvm = False
arg_hash = (
base64.urlsafe_b64encode(hashlib.sha256(arg.encode()).digest())
.decode()
.rstrip("=")
)
if qubes_db.read("/hash-app-dispvm/" + arg_hash) == arg:
force_open_dvm = True
# legacy entry, for short app names only
if (
len(arg) <= 37
and qubes_db.read("/qubes-service/app-dispvm." + arg) is not None
):
force_open_dvm = True
if force_open_dvm:
for bad_var in ('XDG_DATA_HOME', 'GNOME_DESKTOP_SESSION_ID'):
try:
del os.environ[bad_var]
Expand Down
4 changes: 2 additions & 2 deletions rpm_spec/core-agent.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ then
changed=true
fi

if [ "x$changed" != "x" ]
if [ "x$changed" != "x" ] && [ -e /run/systemd/system ]
then
systemctl daemon-reload
fi
Expand Down Expand Up @@ -1334,7 +1334,7 @@ then
changed=true
fi

if [ "x$changed" != "x" ]
if [ "x$changed" != "x" ] && [ -e /run/systemd/system ]
then
systemctl daemon-reload
fi
Expand Down