Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ let run_some_tests repeat_count filter =

| None -> failwith (Printf.sprintf "no test matches '%s'" filter);;

let check_root () =
let allow_root =
try
let _ = Unix.getenv "ARAKOON_RUN_AS_ROOT" in
true
with Not_found -> false
in
if allow_root
then ()
else begin
let root_uid = 0 in
let euid = Unix.geteuid () in
if euid = root_uid
then failwith "Running as root is not supported"
end

let main () =
Ssl_threads.init ();
Expand Down Expand Up @@ -449,6 +464,7 @@ let main () =
match node with
| Node ->
begin
check_root ();
let canonical =
if !config_file.[0] = '/'
then !config_file
Expand Down