Skip to content

Commit e4d28d8

Browse files
authored
set bootstrap to 755 if not executable (#21)
1 parent d69fb6a commit e4d28d8

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmd/localstack/awsutil.go

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
log "github.com/sirupsen/logrus"
1212
"go.amzn.com/lambda/interop"
1313
"go.amzn.com/lambda/rapidcore"
14+
"golang.org/x/sys/unix"
1415
"io"
1516
"io/fs"
1617
"math"
@@ -77,6 +78,15 @@ func getBootstrap(args []string) (*rapidcore.Bootstrap, string) {
7778
log.Panic("insufficient arguments: bootstrap not provided")
7879
}
7980

81+
err := unix.Access(bootstrapLookupCmd[0], unix.X_OK)
82+
if err != nil {
83+
log.Debug("Bootstrap not executable, setting permissions to 0755...", bootstrapLookupCmd[0])
84+
err = os.Chmod(bootstrapLookupCmd[0], 0755)
85+
if err != nil {
86+
log.Warn("Error setting bootstrap to 0755 permissions: ", bootstrapLookupCmd[0], err)
87+
}
88+
}
89+
8090
return rapidcore.NewBootstrapSingleCmd(bootstrapLookupCmd, currentWorkingDir), handler
8191
}
8292

0 commit comments

Comments
 (0)