fix: ensure chowned properties always have a user and group set
Depending on the execution path, the variables may not be set at the top-level. Closes #3328
This commit is contained in:
@@ -144,6 +144,13 @@ func setPermissions(path string, fileMode os.FileMode) (err error) {
|
||||
|
||||
systemGroup := os.Getenv("DOKKU_SYSTEM_GROUP")
|
||||
systemUser := os.Getenv("DOKKU_SYSTEM_USER")
|
||||
if systemGroup == "" {
|
||||
systemGroup = "dokku"
|
||||
}
|
||||
if systemUser == "" {
|
||||
systemUser = "dokku"
|
||||
}
|
||||
|
||||
group, err := user.LookupGroup(systemGroup)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user