Skip to content

Commit

Permalink
change: permission from 644 to 755
Browse files Browse the repository at this point in the history
  • Loading branch information
k1m0ch1 committed Apr 13, 2022
1 parent 6dceb89 commit e29ebe2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions utils/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (cfg *UserConfig) GenerateConfig(name string) error {
return err
}

err = os.WriteFile("./config.yml", bytes, 0644)
err = os.WriteFile("./config.yml", bytes, 0755)
if err != nil {
return err
}
Expand Down Expand Up @@ -129,7 +129,7 @@ func (cfg *UserConfig) GenerateHost(host string) error {

pathDir := fmt.Sprintf("./%s", cfg.DirConfig.HostsIdentityDir)
if _, err := os.Stat(pathDir); os.IsNotExist(err) {
err := os.MkdirAll(pathDir, 0644)
err := os.MkdirAll(pathDir, 0755)
if err != nil {
return err
}
Expand All @@ -139,7 +139,7 @@ func (cfg *UserConfig) GenerateHost(host string) error {
if err != nil {
return err
}
err = os.WriteFile(fmt.Sprintf("./%s/%s.yml", cfg.DirConfig.HostsIdentityDir, host), bytes, 0644)
err = os.WriteFile(fmt.Sprintf("./%s/%s.yml", cfg.DirConfig.HostsIdentityDir, host), bytes, 0755)
if err != nil {
return err
}
Expand Down Expand Up @@ -239,13 +239,13 @@ func (cfg *UserConfig) GenerateVuln(host string, nameVuln string) error {
}
pathDir := fmt.Sprintf("./%s/%s", cfg.DirConfig.VulnDir, host)
if _, err := os.Stat(pathDir); os.IsNotExist(err) {
err := os.MkdirAll(pathDir, 0644)
err := os.MkdirAll(pathDir, 0755)
if err != nil {
return err
}
}

err = os.WriteFile(fmt.Sprintf("./%s/%s/%s.yml", cfg.DirConfig.VulnDir, host, nameVuln), bytes, 0644)
err = os.WriteFile(fmt.Sprintf("./%s/%s/%s.yml", cfg.DirConfig.VulnDir, host, nameVuln), bytes, 0755)
if err != nil {
return err
}
Expand All @@ -258,7 +258,7 @@ func (cfg *UserConfig) GenerateUserConfig() []byte {
if err != nil {
log.Fatalf("Marshal: %v", err)
}
err = os.WriteFile("./config.yml", bytes, 0644)
err = os.WriteFile("./config.yml", bytes, 0755)
if err != nil {
log.Printf("err #%v ", err)
}
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func WalkMatch(root, pattern string) ([]string, error) {
func CheckDirAndCreate(paths string) (bool, error) {
if _, err := os.Stat(paths); os.IsNotExist(err) {
fmt.Printf("\n[?] The dir %s is not yet created, I will create this", paths)
err := os.Mkdir(paths, 0644)
err := os.Mkdir(paths, 0755)
if err != nil {
return false, err
}
Expand Down

0 comments on commit e29ebe2

Please sign in to comment.