package lxc

import (
	"fmt"
	"github.com/docker/libcontainer/namespaces"
	"github.com/docker/libcontainer/utils"
)

func finalizeNamespace(args *InitArgs) error {
	if err := utils.CloseExecFrom(3); err != nil {
		return err
	}

	if err := namespaces.SetupUser(args.User); err != nil {
		return fmt.Errorf("setup user %s", err)
	}

	if err := setupWorkingDirectory(args); err != nil {
		return err
	}

	return nil
}

package lxc

import (
	"fmt"

	"github.com/docker/libcontainer"
	"github.com/docker/libcontainer/namespaces"
	"github.com/docker/libcontainer/utils"
)

func finalizeNamespace(args *InitArgs) error {
	if err := utils.CloseExecFrom(3); err != nil {
		return err
	}
	if err := namespaces.SetupUser(&libcontainer.Config{
		User: args.User,
	}); err != nil {
		return fmt.Errorf("setup user %s", err)
	}
	if err := setupWorkingDirectory(args); err != nil {
		return err
	}
	return nil
}

Update lxc with libcontainer SetupUser change
Update lxc with libcontainer SetupUser change

Signed-off-by: Michael Crosby <951f4c7b5d47e32d0112c78d14a98eaa23e6b5ef@gmail.com>
