Skip to content

Commit

Permalink
Set IPC socket group ownership to addon (#134)
Browse files Browse the repository at this point in the history
Co-authored-by: Mattias Axelsson <[email protected]>
  • Loading branch information
github-actions[bot] and killenheladagen authored Apr 19, 2024
1 parent fd44702 commit 9f804f3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/dockerdwrapperwithcompose.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,13 @@ static const char* build_daemon_args(const struct settings* settings, AXParamete
if (use_ipc_socket) {
g_strlcat(msg, " with IPC socket and", msg_len);
uid_t uid = getuid();
uid_t gid = getgid();
// The socket should reside in the user directory and have same group as user
// The socket should reside in the user directory and have same group as user.
// If omitted, dockerd will log a warning about the 'docker' group not being find.
// However, rootlesskit maps the user's primary group to the root group, so "--group 0"
// means the socket will belong to the user's primary group.
args_offset += g_snprintf(args + args_offset,
args_len - args_offset,
" --group %d -H unix:///var/run/user/%d/docker.sock",
gid,
" --group 0 -H unix:///var/run/user/%d/docker.sock",
uid);
} else {
g_strlcat(msg, " without IPC socket and", msg_len);
Expand Down

0 comments on commit 9f804f3

Please sign in to comment.