Skip to content

Create privileged executable for refreshing groups#2532

Open
Databean wants to merge 1 commit intogoogle:mainfrom
Databean:cvd_refresh_groups
Open

Create privileged executable for refreshing groups#2532
Databean wants to merge 1 commit intogoogle:mainfrom
Databean:cvd_refresh_groups

Conversation

@Databean
Copy link
Copy Markdown
Member

@Databean Databean commented May 7, 2026

acloud relies on sg to refresh group membership if the user has joined the cvdnetwork / kvm / render groups but has not yet restarted or re-logged in.

Debian 13 changed providers of sg / newgrp from shadow to util-linux. In the util-linux implementation, sg only updates the primary group but does not update secondary groups.

Since sg no longer works to refresh the apparent secondary group memberships, we'll need an alternative implementation.

Mechanism for raising privilege copied from https://www.github.com/google/android-cuttlefish/pull/1706

Sample invocation:

cvd_refresh_groups /usr/bin/groups groups

Bug: b/510899675

@Databean Databean requested a review from 3405691582 May 7, 2026 23:00
@Databean Databean force-pushed the cvd_refresh_groups branch from b24ff4f to 37aebb8 Compare May 7, 2026 23:01
@Databean Databean added the kokoro:run Run e2e tests. label May 7, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed the kokoro:run Run e2e tests. label May 7, 2026
@Databean Databean force-pushed the cvd_refresh_groups branch from 37aebb8 to b2f98cc Compare May 7, 2026 23:10
`acloud` relies on [`sg`](https://man7.org/linux/man-pages/man1/sg.1.html) to [refresh group membership](https://cs.android.com/android/platform/superproject/+/android-latest-release:tools/acloud/internal/lib/utils.py;l=1322;drc=02cef780efe034b789d0e3708d4929d2f236327b) if the user has joined the `cvdnetwork` / `kvm` / `render` groups but has not yet restarted or re-logged in.

Debian 13 changed providers of `sg` / `newgrp` from `shadow` to `util-linux`. In the `util-linux` implementation, `sg` only updates the primary group but does not update secondary groups.

- https://www.github.com/util-linux/util-linux/issues/4098
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1130245

Since `sg` no longer works to refresh the apparent secondary group memberships, we'll need an alternative implementation.

Mechanism for raising privilege copied from https://www.github.com/google/android-cuttlefish/pull/1706

Sample invocation:
```
cvd_refresh_groups /usr/bin/groups groups
```

Bug: b/510899675
@Databean Databean force-pushed the cvd_refresh_groups branch from b2f98cc to 0ed406b Compare May 8, 2026 02:01
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.

2 participants