Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade errors about incompatible service config to warnings #168

Merged
merged 1 commit into from
Jun 14, 2024
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
16 changes: 8 additions & 8 deletions libqrexec/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,21 +748,21 @@ int find_qrexec_service(
if (euidaccess(path_buffer.data, X_OK) == 0) {
/* Executable-based service. */
if (!cmd->send_service_descriptor) {
LOG(ERROR, "Refusing to execute executable service %s with skip-service-descriptor=true",
LOG(WARNING, "Warning: ignoring skip-service-descriptor=true "
"for execute executable service %s",
path_buffer.data);
return -2;
}
if (cmd->exit_on_stdout_eof) {
LOG(ERROR, "Refusing to execute executable service %s with "
"exit-on-service-eof=true",
LOG(WARNING, "Warning: ignoring exit-on-service-eof=true "
"for executable service %s",
path_buffer.data);
return -2;
cmd->exit_on_stdout_eof = false;
}
if (cmd->exit_on_stdin_eof) {
LOG(ERROR, "Refusing to execute executable service %s with "
"exit-on-client-eof=true",
LOG(WARNING, "Warning: ignoring exit-on-client-eof=true "
"for executable service %s",
path_buffer.data);
return -2;
cmd->exit_on_stdin_eof = false;
}
return 0;
}
Expand Down
16 changes: 4 additions & 12 deletions qrexec/tests/socket/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ def test_exec_service_with_config(self):
) as f:
f.write("""\
wait-for-session = 0
# should be ignored for executable service
exit-on-service-eof = true
exit-on-client-eof = true
skip-service-descriptor = true
""")
target, dom0 = self.execute_qubesrpc("qubes.Service+arg", "domX")
target.send_message(qrexec.MSG_DATA_STDIN, b"")
Expand Down Expand Up @@ -594,18 +598,6 @@ def test_exec_service_with_invalid_config_5(self):
def test_exec_service_with_invalid_config_6(self):
self.exec_service_with_invalid_config(None)

def test_exec_service_with_invalid_config_7(self):
# skip-service-descriptor not allowed with executable service
self.exec_service_with_invalid_config("skip-service-descriptor = true\n")

def test_exec_service_with_invalid_config_8(self):
# exit-on-service-eof not allowed with executable service
self.exec_service_with_invalid_config("exit-on-service-eof = true\n")

def test_exec_service_with_invalid_config_9(self):
# exit-on-client-eof not allowed with executable service
self.exec_service_with_invalid_config("exit-on-client-eof = true\n")

def test_exec_service_with_arg(self):
self.make_executable_service(
"local-rpc",
Expand Down