Skip to content

Commit

Permalink
fix: require sudo for cortex update (#1318)
Browse files Browse the repository at this point in the history
* fix: require sudo for cortex update

* fix: comment
  • Loading branch information
vansangpfiev authored Sep 24, 2024
1 parent 5e7bda4 commit 623e870
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions engine/controllers/command_line_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ void CommandLineParser::SetupSystemCommands() {
update_cmd->group(kSystemGroup);
update_cmd->add_option("-v", cml_data_.cortex_version, "");
update_cmd->callback([this] {
#if !defined(_WIN32)
if (getuid()) {
CLI_LOG("Error: Not root user. Please run with sudo.");
return;
}
#endif
commands::CortexUpdCmd cuc;
cuc.Exec(cml_data_.cortex_version);
cml_data_.check_upd = false;
Expand Down

0 comments on commit 623e870

Please sign in to comment.