Skip to content

Commit

Permalink
manifest: add shadow-utils and pam when users are created
Browse files Browse the repository at this point in the history
org.osbuild.users runs useradd, usermod, passwd, and mkhomedir_helper in
the os tree using chroot. Most image types should already have the
required packages, but some minimal image types, like 'tar' don't, so
let's add them for the stage to run and to enable user management in the
image.
  • Loading branch information
achilleas-k authored and bcl committed Jun 10, 2024
1 parent 530d150 commit b6fd436
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/manifest/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ func (p *OS) getPackageSetChain(Distro) []rpmmd.PackageSet {
}
}

if len(p.Users) > 0 {
// org.osbuild.users runs useradd, usermod, passwd, and
// mkhomedir_helper in the os tree using chroot. Most image types
// should already have the required packages, but some minimal image
// types, like 'tar' don't, so let's add them for the stage to run and
// to enable user management in the image.
packages = append(packages, "shadow-utils", "pam")

}

osRepos := append(p.repos, p.ExtraBaseRepos...)

chain := []rpmmd.PackageSet{
Expand Down

0 comments on commit b6fd436

Please sign in to comment.