Commit f3d7e4ca by Serge Hallyn Committed by Stéphane Graber

chown_mapped_rootid: don't double-map root id

If the user maps container root to his host uid, chown_mapped_rootid tries to make the same mapping twice and gets -EINVAL. Reported-by: 's avatarAndy Whitcroft <apw@canonical.com> Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 94863add
...@@ -3439,6 +3439,13 @@ int chown_mapped_root(char *path, struct lxc_conf *conf) ...@@ -3439,6 +3439,13 @@ int chown_mapped_root(char *path, struct lxc_conf *conf)
} }
return 0; return 0;
} }
if (rootid == geteuid()) {
// nothing to do
INFO("%s: container root is our uid; no need to chown" ,__func__);
return 0;
}
pid = fork(); pid = fork();
if (pid < 0) { if (pid < 0) {
SYSERROR("Failed forking"); SYSERROR("Failed forking");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment