merge #4649 into opencontainers/runc:release-1.2

lifubang (2):
  libct: don't send config to nsexec when joining an existing timens
  test: exec into a container with private time ns

LGTMs: cyphar lifubang
This commit is contained in:
Aleksa Sarai
2025-02-27 16:05:17 +11:00
2 changed files with 23 additions and 2 deletions
+3 -2
View File
@@ -1114,8 +1114,9 @@ func (c *Container) bootstrapData(cloneFlags uintptr, nsMaps map[configs.Namespa
Value: c.config.RootlessEUID,
})
// write boottime and monotonic time ns offsets.
if c.config.TimeOffsets != nil {
// write boottime and monotonic time ns offsets only when we are not joining an existing time ns
_, joinExistingTime := nsMaps[configs.NEWTIME]
if !joinExistingTime && c.config.TimeOffsets != nil {
var offsetSpec bytes.Buffer
for clock, offset := range c.config.TimeOffsets {
fmt.Fprintf(&offsetSpec, "%s %d %d\n", clock, offset.Secs, offset.Nanosecs)