Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 623e870

Browse files
authored
fix: require sudo for cortex update (#1318)
* fix: require sudo for cortex update * fix: comment
1 parent 5e7bda4 commit 623e870

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

engine/controllers/command_line_parser.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,12 @@ void CommandLineParser::SetupSystemCommands() {
388388
update_cmd->group(kSystemGroup);
389389
update_cmd->add_option("-v", cml_data_.cortex_version, "");
390390
update_cmd->callback([this] {
391+
#if !defined(_WIN32)
392+
if (getuid()) {
393+
CLI_LOG("Error: Not root user. Please run with sudo.");
394+
return;
395+
}
396+
#endif
391397
commands::CortexUpdCmd cuc;
392398
cuc.Exec(cml_data_.cortex_version);
393399
cml_data_.check_upd = false;

0 commit comments

Comments
 (0)