Navigation Menu

Skip to content

Commit

Permalink
criu: Ensure other users cannot read c/r files
Browse files Browse the repository at this point in the history
No checkpoint files should be readable by
anyone else but the user creating it.

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
  • Loading branch information
rst0git committed Oct 17, 2019
1 parent 4e37017 commit a610a84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libcontainer/container_linux.go
Expand Up @@ -940,15 +940,15 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {

// Since a container can be C/R'ed multiple times,
// the checkpoint directory may already exist.
if err := os.Mkdir(criuOpts.ImagesDirectory, 0755); err != nil && !os.IsExist(err) {
if err := os.Mkdir(criuOpts.ImagesDirectory, 0700); err != nil && !os.IsExist(err) {
return err
}

if criuOpts.WorkDirectory == "" {
criuOpts.WorkDirectory = filepath.Join(c.root, "criu.work")
}

if err := os.Mkdir(criuOpts.WorkDirectory, 0755); err != nil && !os.IsExist(err) {
if err := os.Mkdir(criuOpts.WorkDirectory, 0700); err != nil && !os.IsExist(err) {
return err
}

Expand Down Expand Up @@ -1246,7 +1246,7 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
}
// Since a container can be C/R'ed multiple times,
// the work directory may already exist.
if err := os.Mkdir(criuOpts.WorkDirectory, 0655); err != nil && !os.IsExist(err) {
if err := os.Mkdir(criuOpts.WorkDirectory, 0700); err != nil && !os.IsExist(err) {
return err
}
workDir, err := os.Open(criuOpts.WorkDirectory)
Expand Down

0 comments on commit a610a84

Please sign in to comment.