Skip to content

Commit

Permalink
Add error to data_with_permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Aug 25, 2023
1 parent 017eea9 commit 62bbafa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/config/zz_hclparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func customHCLFuncDockerHost() (string, error) {
}

func customHCLFuncDataFolderWithPermissions(name string, permissions int) (string, error) {
if permissions > 0 && permissions < 778 {
return "", fmt.Errorf("permissions must be a three digit number less than 777")
}

// convert the permissions to an octal e.g. 777 to 0777
strInt := fmt.Sprintf("0%d", permissions)
oInt, _ := strconv.ParseInt(strInt, 8, 64)
Expand Down

0 comments on commit 62bbafa

Please sign in to comment.