From 0fd1c2574d9dd8e4acf4742b1c798818213b3a49 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Thu, 6 Jul 2023 17:25:25 +0200 Subject: [PATCH] set bootstrap to 755 if not executable --- cmd/localstack/awsutil.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/localstack/awsutil.go b/cmd/localstack/awsutil.go index b28d734..2f78acf 100644 --- a/cmd/localstack/awsutil.go +++ b/cmd/localstack/awsutil.go @@ -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" @@ -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 }