Skip to content

Commit

Permalink
Replace direct use of su with sudo su
Browse files Browse the repository at this point in the history
To avoid complications when running in restricted pod security standard environment loft-sh/devpod-provider-kubernetes#12
  • Loading branch information
nrontsis authored Oct 12, 2024
1 parent 33b168c commit 1367692
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/devcontainer/setup/lifecyclehooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func run(commands []types.LifecycleHook, user, dir string, remoteEnv map[string]
log.Infof("Run command %s: %s...", k, strings.Join(c, " "))
args := []string{}
if user != "root" {
args = append(args, "su", user, "-c", command.Quote(c))
args = append(args, "sudo", "su", user, "-c", command.Quote(c))
} else {
args = append(args, "sh", "-c", command.Quote(c))
}
Expand Down

0 comments on commit 1367692

Please sign in to comment.