diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-15 15:03:56 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-07-15 15:03:56 +0200 |
| commit | 0a2677411bc1a589c70a089333d943c026eac5ac (patch) | |
| tree | fa8dc98c42b27926564ff6e710892ffdf292c591 /internal/util | |
| parent | 4f473a5d10bc1c9c659ffebf632f7d49c61c9a53 (diff) | |
Util: Create directory with 700 permissions
Diffstat (limited to 'internal/util')
| -rw-r--r-- | internal/util/util.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/util/util.go b/internal/util/util.go index f77d34c..81bd53b 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -27,7 +27,8 @@ func GenerateTimeSeconds() int64 { } func EnsureDirectory(directory string) error { - mkdirErr := os.MkdirAll(directory, os.ModePerm) + // Create with 700 permissions, read, write, execute only for the owner + mkdirErr := os.MkdirAll(directory, 0o700) if mkdirErr != nil { return &types.WrappedErrorMessage{Message: fmt.Sprintf("failed to create directory %s", directory), Err: mkdirErr} } |
