enum {
JAIL_ATTR_NAME,
+ JAIL_ATTR_HOSTNAME,
JAIL_ATTR_PROCFS,
JAIL_ATTR_SYSFS,
JAIL_ATTR_UBUS,
static const struct blobmsg_policy jail_attr[__JAIL_ATTR_MAX] = {
[JAIL_ATTR_NAME] = { "name", BLOBMSG_TYPE_STRING },
+ [JAIL_ATTR_HOSTNAME] = { "hostname", BLOBMSG_TYPE_STRING },
[JAIL_ATTR_PROCFS] = { "procfs", BLOBMSG_TYPE_BOOL },
[JAIL_ATTR_SYSFS] = { "sysfs", BLOBMSG_TYPE_BOOL },
[JAIL_ATTR_UBUS] = { "ubus", BLOBMSG_TYPE_BOOL },
argv[argc++] = jail->name;
}
+ if (jail->hostname) {
+ argv[argc++] = "-h";
+ argv[argc++] = jail->hostname;
+ }
+
if (in->seccomp) {
argv[argc++] = "-S";
argv[argc++] = in->seccomp;
jail->name = blobmsg_get_string(tb[JAIL_ATTR_NAME]);
jail->argc += 2;
}
+ if (tb[JAIL_ATTR_HOSTNAME]) {
+ jail->hostname = blobmsg_get_string(tb[JAIL_ATTR_HOSTNAME]);
+ jail->argc += 2;
+ }
if (tb[JAIL_ATTR_PROCFS]) {
jail->procfs = blobmsg_get_bool(tb[JAIL_ATTR_PROCFS]);
jail->argc++;
void *r = blobmsg_open_table(b, "jail");
if (in->jail.name)
blobmsg_add_string(b, "name", in->jail.name);
+ if (in->jail.hostname)
+ blobmsg_add_string(b, "hostname", in->jail.hostname);
blobmsg_add_u8(b, "procfs", in->jail.procfs);
blobmsg_add_u8(b, "sysfs", in->jail.sysfs);
blobmsg_add_u8(b, "ubus", in->jail.ubus);