Skip to content

Commit

Permalink
Minor fixes for permissions and cert checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jomann09 committed Jan 18, 2024
1 parent 740e045 commit 9702a60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/manager/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func Register() {
}

if !r.Activated {
config.Log.Info("Activation required: Waiting for registration approval in ReChecked Manager")
config.Log.Info("ReChecked Manager Activation Required: Waiting for registration approval in ReChecked Manager")
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions internal/manager/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func updateSecrets() bool {
}

// Make sure the directory exists
os.MkdirAll(config.GetConfigDirFilePath("manager"), os.ModeDir)
os.MkdirAll(config.GetConfigDirFilePath("manager"), 0755)

f := config.GetConfigDirFilePath("manager/secrets.json")
if err := os.WriteFile(f, json, 0666); err != nil {
Expand Down Expand Up @@ -62,7 +62,7 @@ func updateConfigs() bool {
}

// Make sure the directory exists
os.MkdirAll(config.GetConfigDirFilePath("manager"), os.ModeDir)
os.MkdirAll(config.GetConfigDirFilePath("manager"), 0755)

// Remove all config files from manager directory, this is to make sure
// we are synced with the manager's configs
Expand Down Expand Up @@ -113,7 +113,7 @@ func updateConfigs() bool {
}

// Make sure the directory exists
err = os.MkdirAll(config.GetPluginDirFilePath("manager"), os.ModeDir)
err = os.MkdirAll(config.GetPluginDirFilePath("manager"), 0755)
if err != nil {
config.Log.Error(err)
return false
Expand Down
5 changes: 3 additions & 2 deletions internal/manager/secure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/x509"
"encoding/json"
"encoding/pem"
"math/big"
"os"
"time"

Expand Down Expand Up @@ -82,7 +83,7 @@ func validateCert(restart chan<- struct{}) {

err := RequestCert(certFn, keyFn)
if err != nil {

config.Log.Error(err)
return
}

Expand All @@ -106,7 +107,7 @@ func isCertRequestNeeded(fn string) bool {
}

// Internally generated certificates will be overwritten
if cert.SerialNumber.Int64() == INTERNAL_CERT_SERIAL_NUMBER {
if cert.SerialNumber == big.NewInt(INTERNAL_CERT_SERIAL_NUMBER) {
return true
}

Expand Down

0 comments on commit 9702a60

Please sign in to comment.