| 237 | } |
| 238 | |
| 239 | bool 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 | |
| 249 | void OHDUtil::terminate_if_not_root() { |
| 250 | if (!check_root(false)) { |