mirror of
https://github.com/opencontainers/runc.git
synced 2026-04-22 23:17:17 +08:00
libct: don't send config to nsexec when joining an existing timens
We should configure the process's timens offset only when we need to create new time namespace, we shouldn't do it if we are joining an existing time namespace. (#4635) Signed-off-by: lifubang <lifubang@acmcoder.com>
This commit is contained in:
@@ -1146,8 +1146,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)
|
||||
|
||||
Reference in New Issue
Block a user