Skip to content

Read and check the docker command file before changing worker directory ownership - #9007

Merged
rzo1 merged 1 commit into
masterfrom
worker-launcher-docker-command-file
Aug 23, 2026
Merged

Read and check the docker command file before changing worker directory ownership#9007
rzo1 merged 1 commit into
masterfrom
worker-launcher-docker-command-file

Conversation

@reiabreu

Copy link
Copy Markdown
Contributor

launch-docker-container now parses the command file before setup_dir_permissions changes the worker directory's ownership. parse_docker_command_file opens the file with O_NOFOLLOW and requires it to be a regular file owned by the worker-launcher user (or root) and not writable by others. run_docker_cmd is split into parse_docker_command_file + exec_docker_cmd so the parse runs first.

How this was tested

Built the worker-launcher native tree with autoreconf -i && ./configure && make check (autotools, compiled with -Werror); the test suite passes.

…ry ownership

launch-docker-container now parses the command file before setup_dir_permissions
changes the worker directory's ownership. parse_docker_command_file opens the
file with O_NOFOLLOW and requires it to be a regular file owned by the
worker-launcher user (or root) and not writable by others. run_docker_cmd is
split into parse_docker_command_file + exec_docker_cmd so the parse runs first.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@GGraziadei GGraziadei left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

}

stream = fopen(command_file, "r");
int fd = open(command_file, O_RDONLY | O_NOFOLLOW);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 in using directly posix syscall!

@rzo1
rzo1 merged commit c8a1474 into master Aug 23, 2026
7 checks passed
@rzo1 rzo1 added this to the 3.1.0 milestone Aug 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants