diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-06-19 23:41:36 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-06-20 00:16:35 +0900 |
| commit | cb618093d5a2156e6c5a03eaf8ca7d370bf33740 (patch) | |
| tree | 7bf8488b7dc0c81f75c6bd96f2da5b1dca9241c2 /hst/container.go | |
| parent | b0b2471c0cd783c670ed7531d5512415259f551d (diff) | |
hst: optionally disable file placement
This works around stubborn package managers.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'hst/container.go')
| -rw-r--r-- | hst/container.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/hst/container.go b/hst/container.go index a34efc32..824b0982 100644 --- a/hst/container.go +++ b/hst/container.go @@ -65,6 +65,8 @@ const ( // Some programs fail to connect to dbus session running as a different uid, // this option works around it by mapping priv-side caller uid in container. FMapRealUID + // FNoPlace disables placement of /etc/passwd and /etc/group. + FNoPlace // FDevice mount /dev/ from the init mount namespace as is in the container // mount namespace. @@ -101,6 +103,8 @@ func (flags Flags) String() string { return "tty" case FMapRealUID: return "mapuid" + case FNoPlace: + return "noplace" case FDevice: return "device" case FCoverRun: @@ -197,6 +201,8 @@ type containerConfigJSON = struct { // Corresponds to [FMapRealUID]. MapRealUID bool `json:"map_real_uid"` + // Corresponds to [FNoPlace]. + NoPlace bool `json:"noplace,omitempty"` // Corresponds to [FDevice]. Device bool `json:"device,omitempty"` @@ -224,6 +230,7 @@ func (c *ContainerConfig) MarshalJSON() ([]byte, error) { Tty: c.Flags&FTty != 0, Multiarch: c.Flags&FMultiarch != 0, MapRealUID: c.Flags&FMapRealUID != 0, + NoPlace: c.Flags&FNoPlace != 0, Device: c.Flags&FDevice != 0, CoverRun: c.Flags&FCoverRun != 0, ShareRuntime: c.Flags&FShareRuntime != 0, @@ -266,6 +273,9 @@ func (c *ContainerConfig) UnmarshalJSON(data []byte) error { if v.MapRealUID { c.Flags |= FMapRealUID } + if v.NoPlace { + c.Flags |= FNoPlace + } if v.Device { c.Flags |= FDevice } |
