Commit 4e2121f5 by dlezcano

Remove nsgroup directory when the container dies

From: Daniel Lezcano <daniel.lezcano@free.fr> Remove the nsgroup directory when the container dies, otherwise this will lead to an error when the pids number are recycled Signed-off-by: 's avatarDaniel Lezcano <daniel.lezcano@free.fr> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 80a992f7
...@@ -92,8 +92,13 @@ int lxc_link_nsgroup(const char *name, pid_t pid) ...@@ -92,8 +92,13 @@ int lxc_link_nsgroup(const char *name, pid_t pid)
int lxc_unlink_nsgroup(const char *name) int lxc_unlink_nsgroup(const char *name)
{ {
char nsgroup[MAXPATHLEN]; char nsgroup[MAXPATHLEN];
char path[MAXPATHLEN];
snprintf(nsgroup, MAXPATHLEN, LXCPATH "/%s/nsgroup", name); snprintf(nsgroup, MAXPATHLEN, LXCPATH "/%s/nsgroup", name);
if (readlink(nsgroup, path, MAXPATHLEN) > 0)
rmdir(path);
return unlink(nsgroup); return unlink(nsgroup);
} }
......
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