}
/* allocate combined mapping string */
- map = calloc(1 + totallen, sizeof(char));
+ map = malloc(1 + totallen);
if (!map)
return ENOMEM;
char *jsonfile;
int ocires;
+ if (!opts.name) {
+ ERROR("OCI bundle needs a named jail\n");
+ ret=-1;
+ goto errout;
+ }
asprintf(&jsonfile, "%s/config.json", opts.ocibundle);
ocires = parseOCI(jsonfile);
free(jsonfile);
}
}
+ if (opts.namespace & CLONE_NEWNET) {
+ if (!opts.name) {
+ ERROR("netns needs a named jail\n");
+ ret=-1;
+ goto errout;
+ }
+ }
+
+
if (opts.tmpoverlaysize && strlen(opts.tmpoverlaysize) > 8) {
ERROR("size parameter too long: \"%s\"\n", opts.tmpoverlaysize);
ret=-1;
}
if (opts.namespace & CLONE_NEWNET) {
- if (!opts.name) {
- ERROR("netns needs a named jail\n");
- free_and_exit(-1);
- }
netns_fd = ns_open_pid("net", jail_process.pid);
netns_updown(jail_process.pid, true);
}
+
if (jail_writepid(jail_process.pid)) {
ERROR("failed to write pidfile: %m\n");
free_and_exit(-1);