MCPcopy
hub / github.com/hardentools/hardentools / checkStatus

Function checkStatus

utils.go:117–135  ·  view source on GitHub ↗

checkStatus checks status of hardentools registry key (that tells if user environment is hardened / not hardened).

()

Source from the content-addressed store, hash-verified

115// checkStatus checks status of hardentools registry key
116// (that tells if user environment is hardened / not hardened).
117func checkStatus() bool {
118 key, err := registry.OpenKey(registry.CURRENT_USER, hardentoolsKeyPath,
119 registry.READ)
120 if err != nil {
121 return false
122 }
123 defer key.Close()
124
125 value, _, err := key.GetIntegerValue("Harden")
126 if err != nil {
127 return false
128 }
129
130 if value == 1 {
131 return true
132 }
133
134 return false
135}
136
137// markStatus sets hardentools status registry key
138// (that tells if user environment is hardened / not hardened).

Callers 3

mainFunction · 0.85
cmdHardenRestoreFunction · 0.85
createMainGUIContentFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected