Skip to content

Commit 41c47cf

Browse files
FedeParolafrisso
authored andcommitted
Generate polycubectl config directory with traverse permission (#248)
* Generate polycubectl config directory with traverse permission
1 parent e2c788a commit 41c47cf

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/polycubectl/config/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ func saveConfig(config Config) error {
8585
return fmt.Errorf("error during json Marshal: %s", err.Error())
8686
}
8787

88-
os.MkdirAll(home+PathToConfigFile, 0600)
88+
// Create a directory for the config file with read, write and execute
89+
// permission for the current user (700)
90+
// (both w and x are needed to edit the content of the dir)
91+
os.MkdirAll(home+PathToConfigFile, 0700)
8992

9093
f, err := os.Create(home + PathToConfigFile + ConfigFile)
9194
defer f.Close()

0 commit comments

Comments
 (0)