[#727] util: Add MkdirAllX
func
Add `MkdirAllX` function that wraps `os.MkdirAll` and adds `x` permission for user and group. This is used to make all created dirs openable for user and group regardless of the read config permissions. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
c332188341
commit
51eeae3640
1 changed files with 10 additions and 0 deletions
10
pkg/util/os.go
Normal file
10
pkg/util/os.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package util
|
||||
|
||||
import "os"
|
||||
|
||||
// MkdirAllX calls os.MkdirAll with passed permissions
|
||||
// but with +x for user and group. This makes created
|
||||
// dir openable regardless of the passed permissions.
|
||||
func MkdirAllX(path string, perm os.FileMode) error {
|
||||
return os.MkdirAll(path, perm|0110)
|
||||
}
|
Loading…
Reference in a new issue