Skip to content

Set runtime directory permissions #67

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

Merged
merged 1 commit into from
Mar 27, 2024
Merged
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: 12 additions & 4 deletions app/dockerdwrapperwithcompose.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,7 @@ start_dockerd(void)
}

if (use_ipc_socket) {
// Get uid and gid
uid_t uid = getuid();
// uid_t gid = getgid();

// The socket should reside in the user directory
// TODO: Ideally we would want to set the group ownership here as well, with
Expand Down Expand Up @@ -674,6 +672,9 @@ main(void)
openlog(NULL, LOG_PID, LOG_USER);
syslog(LOG_INFO, "Started logging.");

// Setup signal handling.
init_signals();

// Get UID of the current user
uid_t uid = getuid();

Expand Down Expand Up @@ -714,8 +715,15 @@ main(void)
syslog(LOG_INFO, "DOCKER_HOST: %s", docker_host);
syslog(LOG_INFO, "XDG_RUNTIME_DIR: %s", xdg_runtime_dir);

// Setup signal handling.
init_signals();
// Set permission on XDG_RUNTIME_DIR to give group (addon) members read and
// execute rights. This is needed for other ACAP applications to be able to
// use the IPC socket.
if (chmod(xdg_runtime_dir, 0750) != 0) {
syslog(LOG_ERR,
"Failed to set permissions on runtime directory %s",
xdg_runtime_dir);
goto end;
}

// Setup ax_parameter
ax_parameter = setup_axparameter();
Expand Down