MCPcopy Create free account
hub / github.com/ioi/isolate / init

Function init

isolate.c:1054–1080  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1052}
1053
1054static void
1055init(void)
1056{
1057 if (cf_restricted_init && !invoked_by_root)
1058 die("New sandboxes can be created only by root");
1059
1060 lock_box(true, false);
1061
1062 do_cleanup();
1063
1064 msg("Preparing sandbox\n");
1065 make_dir(box_dir);
1066 if (chdir(box_dir) < 0)
1067 die("chdir(%s): %m", box_dir);
1068 if (mkdir("box", 0700) < 0)
1069 die("Cannot create box: %m");
1070 if (chown("box", orig_uid, orig_gid) < 0)
1071 die("Cannot chown box: %m");
1072
1073 cg_create();
1074 set_quota();
1075
1076 lock.is_initialized = 1;
1077 lock_write();
1078
1079 puts(box_dir);
1080}
1081
1082static void
1083cleanup(void)

Callers 1

mainFunction · 0.85

Calls 7

lock_boxFunction · 0.85
do_cleanupFunction · 0.85
msgFunction · 0.85
make_dirFunction · 0.85
cg_createFunction · 0.85
set_quotaFunction · 0.85
lock_writeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…