Skip to content

Change mode of bootstrap file to 0755 if not executable #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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