mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #2382 from adrianreber/selinux
Fix one (of two) SELinux denials during checkpointing
This commit is contained in:
@ -481,6 +481,19 @@ func (c *Container) checkpoint(ctx context.Context, options ContainerCheckpointO
|
|||||||
if c.state.State != ContainerStateRunning {
|
if c.state.State != ContainerStateRunning {
|
||||||
return errors.Wrapf(ErrCtrStateInvalid, "%q is not running, cannot checkpoint", c.state.State)
|
return errors.Wrapf(ErrCtrStateInvalid, "%q is not running, cannot checkpoint", c.state.State)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create the CRIU log file and label it
|
||||||
|
dumpLog := filepath.Join(c.bundlePath(), "dump.log")
|
||||||
|
|
||||||
|
logFile, err := os.OpenFile(dumpLog, os.O_CREATE, 0600)
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrapf(err, "failed to create CRIU log file %q", dumpLog)
|
||||||
|
}
|
||||||
|
logFile.Close()
|
||||||
|
if err = label.SetFileLabel(dumpLog, c.MountLabel()); err != nil {
|
||||||
|
return errors.Wrapf(err, "failed to label CRIU log file %q", dumpLog)
|
||||||
|
}
|
||||||
|
|
||||||
if err := c.runtime.ociRuntime.checkpointContainer(c, options); err != nil {
|
if err := c.runtime.ociRuntime.checkpointContainer(c, options); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user