MCPcopy Create free account
hub / github.com/OpenHD/OpenHD / check_root

Method check_root

OpenHD/ohd_common/src/openhd_util.cpp:239–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239bool OHDUtil::check_root(const bool print_debug) {
240 const auto uid = getuid();
241 const bool root = uid ? false : true;
242 if (print_debug) {
243 openhd::log::get_default()->debug("UID is:{} root: {}", uid,
244 OHDUtil::yes_or_no(root));
245 }
246 return root;
247}
248
249void OHDUtil::terminate_if_not_root() {
250 if (!check_root(false)) {

Callers

nothing calls this directly

Calls 2

yes_or_noFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected