Skip to content

Commit

Permalink
buildah: force umask 022
Browse files Browse the repository at this point in the history
an umask more restrictive can break some images.

Closes: containers#1305

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
  • Loading branch information
giuseppe committed Feb 7, 2019
1 parent 50539b5 commit 28b191d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/buildah/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"os"
"syscall"
"time"

"github.com/containers/buildah"
Expand All @@ -13,6 +14,7 @@ import (
"github.com/containers/storage"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
Expand Down Expand Up @@ -88,6 +90,11 @@ func getStore(c *cobra.Command) (storage.Store, error) {
options.GIDMap = gidmap
}

oldUmask := syscall.Umask(0022)
if (oldUmask & ^0022) != 0 {
logrus.Debugf("umask value too restrictive. Forcing it to 022")
}

store, err := storage.GetStore(options)
if store != nil {
is.Transport.SetStore(store)
Expand Down

0 comments on commit 28b191d

Please sign in to comment.