Skip to content

[RFE] support for defining default user groups during build time #106

@SeanDougherty

Description

@SeanDougherty

Current situation

Package maintainers are unable to set default user groups during build time.

Impact

Distros vary on what groups they assign to users by default. For example, Ubuntu, grants the groups: adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, and video. While Azure Linux grants the groups: wheel and sudo.

The recent Builder style API revisions have opened up the ability to define custom user groups when provisioning a user, via the .with_groups() method. However, the solution is not exposed at build time for distro maintainers to utilize this new feature.

Ideal future situation

During build time of azure-init, distro maintainers would be able to specify a list of default groups via build arguments or environment variables.

**Implementation options

Option 1)
Introduce a new env variable DEFAULT_USERADD_GROUPS, that is ingested by azure-init's main.rs and pass this value into a call to .with_groups() during provision(). If DEFAULT_USERADD_GROUPS is empty, continue to default to the singular group "wheel".

Option 2)
Introduce a new build argument to the cargo build command, that is ingested by azure-init's main.rs and pass this value into a call to .with_groups() during provision(). If the build argument is empty, continue to default to the singular group "wheel".

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions