Skip to content

Commit

Permalink
Merge pull request #2829 from KentaTada/refactor-mode-of-factory
Browse files Browse the repository at this point in the history
libcontainer/factory*: adjust the file mode
  • Loading branch information
Mrunal Patel authored Mar 4, 2021
2 parents 50ac158 + 8a3484b commit 497cd0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libcontainer/factory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func CriuPath(criupath string) func(*LinuxFactory) error {
// configures the factory with the provided option funcs.
func New(root string, options ...func(*LinuxFactory) error) (Factory, error) {
if root != "" {
if err := os.MkdirAll(root, 0700); err != nil {
if err := os.MkdirAll(root, 0o700); err != nil {
return nil, newGenericError(err, SystemError)
}
}
Expand Down Expand Up @@ -259,7 +259,7 @@ func (l *LinuxFactory) Create(id string, config *configs.Config) (Container, err
} else if !os.IsNotExist(err) {
return nil, newGenericError(err, SystemError)
}
if err := os.MkdirAll(containerRoot, 0711); err != nil {
if err := os.MkdirAll(containerRoot, 0o711); err != nil {
return nil, newGenericError(err, SystemError)
}
if err := os.Chown(containerRoot, unix.Geteuid(), unix.Getegid()); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion libcontainer/factory_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func TestFactoryLoadContainer(t *testing.T) {
},
}
)
if err := os.Mkdir(filepath.Join(root, id), 0700); err != nil {
if err := os.Mkdir(filepath.Join(root, id), 0o700); err != nil {
t.Fatal(err)
}
if err := marshal(filepath.Join(root, id, stateFilename), expectedState); err != nil {
Expand Down

0 comments on commit 497cd0c

Please sign in to comment.