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: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
int lxc_unlink_nsgroup(const char *name)
{
char nsgroup[MAXPATHLEN];
+ char path[MAXPATHLEN];
snprintf(nsgroup, MAXPATHLEN, LXCPATH "/%s/nsgroup", name);
+
+ if (readlink(nsgroup, path, MAXPATHLEN) > 0)
+ rmdir(path);
+
return unlink(nsgroup);
}