mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
run, create: add --passwd-entry
It allows to customize the entry that is written to the `/etc/passwd` file when --passwd is used. Closes: https://github.com/containers/podman/issues/13185 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -2051,3 +2051,16 @@ func WithChrootDirs(dirs []string) CtrCreateOption {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithPasswdEntry sets the entry to write to the /etc/passwd file.
|
||||
func WithPasswdEntry(passwdEntry string) CtrCreateOption {
|
||||
return func(ctr *Container) error {
|
||||
if ctr.valid {
|
||||
return define.ErrCtrFinalized
|
||||
}
|
||||
|
||||
ctr.config.PasswdEntry = passwdEntry
|
||||
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user