Skip to content

Commit 0d85560

Browse files
committed
Fail service call if config file cannot be read
This includes the case where there is an I/O error or it is e.g. a symlink to a nonexistent file. Fixes: QubesOS/qubes-issues#9100
1 parent 7ed4303 commit 0d85560

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

libqrexec/exec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int load_service_config_raw(struct qrexec_parsed_command *cmd,
285285
if (ret == -1)
286286
ret = find_file(config_path, cmd->service_name,
287287
config_full_path, sizeof(config_full_path), NULL);
288-
if (ret < 0)
288+
if (ret == -1)
289289
return 0;
290290
return qubes_toml_config_parse(config_full_path, &cmd->wait_for_session, user,
291291
&cmd->send_service_descriptor);

qrexec/tests/socket/agent.py

-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ def test_exec_service_with_invalid_config_4(self):
541541
def test_exec_service_with_invalid_config_5(self):
542542
self.exec_service_with_invalid_config("wait-for-session\n")
543543

544-
@unittest.expectedFailure
545544
def test_exec_service_with_invalid_config_6(self):
546545
self.exec_service_with_invalid_config(None)
547546

0 commit comments

Comments
 (0)