Skip to content

Commit

Permalink
Merge pull request #542 from bparees/windows_mode_bits
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Jul 15, 2016
2 parents fdd091d + 82b7e1f commit 9350cd1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/build/strategies/sti/postexecutorstep.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"strings"
"syscall"

"github.com/openshift/source-to-image/pkg/api"
dockerpkg "github.com/openshift/source-to-image/pkg/docker"
Expand Down Expand Up @@ -277,14 +277,20 @@ func (step *startRuntimeImageAndUploadFilesStep) execute(ctx *postExecutorStepCo
if err != nil {
return err
}
// chmod does nothing on windows anyway.
if runtime.GOOS == "windows" {
return nil
}
// Skip chmod for symlinks
if info.Mode()&os.ModeSymlink != 0 {
return nil
}
// file should be writable by owner (u=w) and readable by other users (a=r),
// executable bit should be left as is
mode := os.FileMode(0644)
if info.IsDir() || info.Mode()&syscall.S_IEXEC != 0 {
// syscall.S_IEXEC == 0x40 but we can't reference the constant if we want
// to build releases for windows.
if info.IsDir() || info.Mode()&0x40 != 0 {
mode = 0755
}
return step.fs.Chmod(path, mode)
Expand Down

0 comments on commit 9350cd1

Please sign in to comment.