* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define _GNU_SOURCE
#include <stdio.h>
+#undef _GNU_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <libgen.h>
#include <lxc/log.h>
#include <lxc/namespace.h>
+#include <lxc/cgroup.h>
+#include <lxc/error.h>
lxc_log_define(lxc_unshare_ui, lxc);
{
int opt, status;
int ret;
+ char *pid_name;
char *namespaces = NULL;
char **args;
int flags = 0;
return -1;
}
- return status;
-}
+ if (!asprintf(&pid_name, "%d", pid)) {
+ ERROR("pid_name: failed to allocate memory");
+ return -1;
+ }
+ lxc_unlink_nsgroup(pid_name);
+ free(pid_name);
+ return lxc_error_set_and_log(pid, status);
+}