Skip to content

Commit

Permalink
set bootstrap to 755 if not executable (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfangl authored Jul 6, 2023
1 parent d69fb6a commit e4d28d8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/localstack/awsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
log "github.com/sirupsen/logrus"
"go.amzn.com/lambda/interop"
"go.amzn.com/lambda/rapidcore"
"golang.org/x/sys/unix"
"io"
"io/fs"
"math"
Expand Down Expand Up @@ -77,6 +78,15 @@ func getBootstrap(args []string) (*rapidcore.Bootstrap, string) {
log.Panic("insufficient arguments: bootstrap not provided")
}

err := unix.Access(bootstrapLookupCmd[0], unix.X_OK)
if err != nil {
log.Debug("Bootstrap not executable, setting permissions to 0755...", bootstrapLookupCmd[0])
err = os.Chmod(bootstrapLookupCmd[0], 0755)
if err != nil {
log.Warn("Error setting bootstrap to 0755 permissions: ", bootstrapLookupCmd[0], err)
}
}

return rapidcore.NewBootstrapSingleCmd(bootstrapLookupCmd, currentWorkingDir), handler
}

Expand Down

0 comments on commit e4d28d8

Please sign in to comment.