Skip to content

Commit

Permalink
remove old chmod code
Browse files Browse the repository at this point in the history
  • Loading branch information
dfangl committed Mar 12, 2024
1 parent 704e4e3 commit 13d4050
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions cmd/localstack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,24 +148,6 @@ func main() {
log.Warnln("Could not change file mode of code directories:", err)
}

// set file permissions of the tmp directory for better AWS parity
if err := ChmodRecursively("/tmp", 0700); err != nil {
log.Warnln("Could not change file mode recursively of directory /tmp:", err)
}
// set file permissions of the layers directory for better AWS parity
if err := ChmodRecursively("/opt", 0755); err != nil {
log.Warnln("Could not change file mode recursively of directory /opt:", err)
}
// set file permissions of the code directory if at least one layer is present for better AWS parity
// Limitation: hot reloading likely breaks file permission parity for /var/task in combination with layers
// Heuristic for detecting the presence of layers. It might fail for an empty layer or image-based Lambda.
if isDirEmpty, _ := IsDirEmpty("/opt"); !isDirEmpty {
log.Debugln("Detected layer present")
if err := ChmodRecursively("/var/task", 0755); err != nil {
log.Warnln("Could not change file mode recursively of directory /var/task:", err)
}
}

// parse CLI args
bootstrap, handler := getBootstrap(os.Args)

Expand Down

0 comments on commit 13d4050

Please sign in to comment.