Commit c3f0a28c by dlezcano

Removed useless readlink before chrooting

parent 536b97f0
...@@ -630,13 +630,11 @@ static int setup_utsname(const char *name) ...@@ -630,13 +630,11 @@ static int setup_utsname(const char *name)
static int setup_rootfs(const char *name) static int setup_rootfs(const char *name)
{ {
char path[MAXPATHLEN], chrt[MAXPATHLEN]; char path[MAXPATHLEN];
snprintf(path, MAXPATHLEN, LXCPATH "/%s/rootfs", name); snprintf(path, MAXPATHLEN, LXCPATH "/%s/rootfs", name);
if (readlink(path, chrt, MAXPATHLEN) > 0) { if (chroot(path)) {
if (chroot(chrt)) {
lxc_log_syserror("failed to set chroot %s", path); lxc_log_syserror("failed to set chroot %s", path);
return -1; return -1;
} }
...@@ -645,7 +643,6 @@ static int setup_rootfs(const char *name) ...@@ -645,7 +643,6 @@ static int setup_rootfs(const char *name)
lxc_log_syserror("failed to change to home directory"); lxc_log_syserror("failed to change to home directory");
return -1; return -1;
} }
}
return 0; return 0;
} }
......
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