return ret;
}
-int ttys_shift_ids(struct lxc_conf *c)
+int lxc_ttys_shift_ids(struct lxc_conf *c)
{
if (lxc_list_empty(&c->id_map))
return 0;
- if (strcmp(c->console.name, "") !=0 && chown_mapped_root(c->console.name, c) < 0) {
- ERROR("Failed to chown %s", c->console.name);
+ if (!strcmp(c->console.name, ""))
+ return 0;
+
+ if (chown_mapped_root(c->console.name, c) < 0) {
+ ERROR("failed to chown console \"%s\"", c->console.name);
return -1;
}
+ TRACE("chowned console \"%s\"", c->console.name);
+
return 0;
}
extern int find_unmapped_nsid(struct lxc_conf *conf, enum idtype idtype);
extern int mapped_hostid(unsigned id, struct lxc_conf *conf, enum idtype idtype);
extern int chown_mapped_root(char *path, struct lxc_conf *conf);
-extern int ttys_shift_ids(struct lxc_conf *c);
+extern int lxc_ttys_shift_ids(struct lxc_conf *c);
extern int userns_exec_1(struct lxc_conf *conf, int (*fn)(void *), void *data,
const char *fn_name);
extern int parse_mntopts(const char *mntopts, unsigned long *mntflags,
goto out_restore_sigmask;
}
- if (ttys_shift_ids(conf) < 0) {
+ if (lxc_ttys_shift_ids(conf) < 0) {
ERROR("Failed to shift tty into container.");
goto out_restore_sigmask;
}
conf->console.descr = &descr;
/* Shift ttys to container. */
- if (ttys_shift_ids(conf) < 0) {
+ if (lxc_ttys_shift_ids(conf) < 0) {
ERROR("Failed to shift tty into container");
goto err1;
}