node: dir and file permissions to allow non-root to read UUID
Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
parent
5d6a69806a
commit
39d3b55a34
4
node.go
4
node.go
@ -41,13 +41,13 @@ func InitNodeUUID() (*uuid.UUID, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createNodeUUID() (*uuid.UUID, error) {
|
func createNodeUUID() (*uuid.UUID, error) {
|
||||||
err := os.MkdirAll(CONFIG_PATH, 0600)
|
err := os.MkdirAll(CONFIG_PATH, 0755)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
mode := os.O_RDWR | os.O_CREATE | os.O_EXCL
|
mode := os.O_RDWR | os.O_CREATE | os.O_EXCL
|
||||||
f, err := os.OpenFile(UUID_PATH, mode, 0600)
|
f, err := os.OpenFile(UUID_PATH, mode, 0644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user